Run-time error ‘-2147417848(8001

  • Thread starter Thread starter Atef g
  • Start date Start date
A

Atef g

hello all,
i've simple form to delete sheets and i have the following code:

Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Sheets(UserForm1.ComboBox1.Value).Delete
UserForm1.Hide
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub

when i click commandbutton1
the following error appear and excel is cranshing
Run-time error ‘-2147417848(80010108)’:
Automation error
The object invoked has disconnected from its clients.

i use excel2007 but i run this macro with file ( xls) not (xlsx) or (xlsm).
thanks in advance
atef
 
Hi

I tried your code in an empty workbook and your code works just fine in
XL2007.

Do you have any links or references in other sheets to the sheet which you
tries to delete?

Regards,
Per
 
That message is related to an SQL activity when Excel disconnects from the
web page or another application. Where does ComboBox1 get its values from?
 
Back
Top