Hi,
I'm writing a macro in Excel 2013 and getting Run-time error '-2147417848 (80010108)': Automation error. The object invoked has disconnected from its clients.
I have the error crash here in the module. It works twice, but on the third iteration it gives me this error
For formulaG = 1 To wsL
If Right(ActiveWorkbook.Worksheets(formulaG).Name, 4) = wsA And Len(ActiveWorkbook.Worksheets(formulaG).Name) > 4 Then
wsW = ActiveWorkbook.Worksheets(formulaG).Name
ActiveWorkbook.Worksheets(wsW).Delete
Exit For
End If
Next formulaG
wsL=worksheet count in the workbook. I have option explicit and calculations set to manual, but where it deletes the sheet it crashes. Any suggestions? Thanks!
I'm writing a macro in Excel 2013 and getting Run-time error '-2147417848 (80010108)': Automation error. The object invoked has disconnected from its clients.
I have the error crash here in the module. It works twice, but on the third iteration it gives me this error
For formulaG = 1 To wsL
If Right(ActiveWorkbook.Worksheets(formulaG).Name, 4) = wsA And Len(ActiveWorkbook.Worksheets(formulaG).Name) > 4 Then
wsW = ActiveWorkbook.Worksheets(formulaG).Name
ActiveWorkbook.Worksheets(wsW).Delete
Exit For
End If
Next formulaG
wsL=worksheet count in the workbook. I have option explicit and calculations set to manual, but where it deletes the sheet it crashes. Any suggestions? Thanks!