Link to home
Create AccountLog in
Avatar of londonlife

asked on

Microsoft Visual Basic Run-time error on Excel spreadsheet

I have an excel spreadsheet file as a link on my website.

When a visitor clicks on the link they are prompted to either save or open the file.

When a visitor saves the file and opens it on their PC there are no error messages.

When a visitor opens the spreadsheet from within IE they get the following message:

Microsoft Visual Basic
Run-time error '1004':
Method 'Sheets' of object '_Global' failed

Then the only option is to close the application.

Any ideas on how to get it to work properly when someone opens the file from within the browser?

Thanks so much for your help.
Avatar of Steven Carnahan
Steven Carnahan
Flag of United States of America image

Does the document open in IE or in Excel?   To have the document open in Excel from the link refer to: However this is something that the user needs to do.
Avatar of Norie

Is there any code in this file they are trying to open/download?
I expect there is a macro that runs automatically on opening the file, and when it opens under IE, some required object is not valid (like a file name).

You could test by having a (nearly) empty spreadsheet linked, and see if that gives the same error.
Avatar of londonlife


The spreadsheet is a calculator so there are a bunch of different macros being run in it.

Is there a way to pinpoint which macro is causing the issue or it is just a matter or trial and error?
Avatar of sijpie
Flag of Germany image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account