private void bgWorkerEDI_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; Automation ae = new Automation(); e.Result = ae.ConvertEDI(custRange, worker, e); }