Run-time error ‘-2147417848(8001

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
 
P

Per Jessen

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
 
J

JLGWhiz

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top