ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   runtime error 1004 when opening excel file via VBA in a browser (https://www.excelbanter.com/excel-programming/272846-runtime-error-1004-when-opening-excel-file-via-vba-browser.html)

Ken Hunter

runtime error 1004 when opening excel file via VBA in a browser
 
Hello,

I have an excel spreadsheet that uses a macro to open
another excel spreadsheet via Workbooks.Open(filename)

On my local drive this works fine and it opens the second
file, runs the query, and closes it without complaint.
When I run it via a network drive it works fine as well.

However, when I try to run it via a browser (i.e. put the
file on a web server and then open the url as
http://www.whatever.com/myfile.xls") and then run the
macro I get a runtime error 1004 stating "Method 'Open' of
object 'Workbooks' failed".

Any idea what is causing this?

To complicate matters more, when it gives me the error it
gives me the option of "End" or "Debug". If I click Debug
it brings up the code window. If I then click Run without
making any changes it runs properly.

Help!

Thanks,

Ken Hunter

Ken Hunter[_2_]

runtime error 1004 when opening excel file via VBA in a browser
 
What version of excel is installed on the webserver is
irrelevant as the file is being opened on the client's pc.
(for the record excel is not even on the webserver).

Let me put the problem another way. If you have a file
called c:\file1.xls with a button that does
workbooks.open "c:\file2.xls". Open IE and drag file1.xls
into the browser - it will not work.

And no - making IE load excel outside the browser is not
an option - it is a locked down desktop.

Ken

-----Original Message-----

Ken,

Make sure the correct version of Excel is installed on

the web server. Also
check out the KB article

Q135390 XL: Sample Macro to Open or Activate a Workbook
http://support.microsoft.com/?id=135390

which has information about similar error arising from

Workbook Open /
activation.

Thanks,

Jim

Jim Vita
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and

confers no rights.

.


Jim Vita

runtime error 1004 when opening excel file via VBA in a browser
 

Hi,

If dragging an xls file to the browser window doesn't work then it's most
likely Excel isn't installed properly on the client. It could be the
browser as well. Try doing a repair installation from the control panel.

Thanks,

Jim

Jim Vita
Microsoft Developer Support

Microsoft Security Announcement: Have you installed the patch for Microsoft
Security Bulletin MS03-026?*If not Microsoft strongly advises you to review
the information at the following link regarding Microsoft Security Bulletin
MS03-026 http://www.microsoft.com/security/se...s/ms03-026.asp
and/or to visit Windows Update at http://windowsupdate.microsoft.com to
install the patch. Running the SCAN program from the Windows Update site
will help to insure you are current with all security patches, not just
MS03-026.

This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 01:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com