Link to home
Start Free TrialLog in
Avatar of sgtoverlord
sgtoverlord

asked on

Error when opening Excel 2010 from webpage.

I have a macro-enabled Excel 2010 workbook application that users can get from our webpage.  When a user clicks the link to get the workbook they are presented with a "File Download" dialog box that asks if they wish to OPEN, SAVE, or CANCEL the file.

If user saves it to their PC all the vba code works just fine, and the application functions as expected.  However, if they select OPEN then some users (not all) are getting runtime errors when the workbook opens.

Can anyone point me in the right direction on how to fix this issue?

All users are using Excel 2010
Avatar of Shanan212
Shanan212
Flag of Canada image

Possibly there are macros that run when the file is opened? (open even macro)

They (macro) maybe looking for a specific directory. Since the file could be opened as read-only, it could result in an error.
The difference is that when a user hits "Open" the file is downloaded to a temp folder and then runs from there.

The reason why this is a problem really depends on the specific errors that users encounter. Could you post the exact error messages/codes?
Avatar of sgtoverlord
sgtoverlord

ASKER

Thank you for the quick reply.

Yes, there are macros running when the workbook opens.  I have reviewed the code and in no place is a path or folder specified.
The error is not limited to paths although paths are one of the main reasons.

The error could be due to the fact that when opening, the file would/could be opened as read-only...and the macro could not make changes to the file, then also it would give an error
The problem doesn't have to be a hard-coded path in the macro. For instance, some antivirus software (I know specifically of McAfee) prevent running programs from temp folders. There may be other problems running files like file permissions etc. That's why the specific error that the users encounter would be very helpful.
Recommendation would be to always save the file.

If you still like to open the file but without getting errors (in this case, the file may be opened as read-only)
Then, put in this condition (if statement) in your open-event

if ActiveWorkbook.ReadOnly = true then
exit sub
end if

^ In above case, open macro wont run and hence no-errors.
Urzica,  

Attached is a screenshot of the error msg that one of my users gets.  The hard part in fixing this issue is that not all users are getting errors.  I, myself, do not get the error.  Further, it appears that different users are getting different errors.  arrrrgh.

For instance, some antivirus software (I know specifically of McAfee) prevent running programs from temp folders
Funny, we do actually use McAfee.  But wouldn't a McAfee popup fire off if it was stopping a program/code from running?
Runtime-error-1004.JPG
SOLUTION
Avatar of urzica
urzica
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I just checked the McAfee protection log, and it shows that this program would have been blocked (due to temp internet folder) but rule is not enforced at this time.
However, I agree with Shanan212's recommendation. Since there are several errors, why not let users run the document only if they save it first?
I agree with both of you.  Unfortunately, the business owner of our project has made this a functional requirement.  I am trying to push back, but my guess is that they will not accept that it can not be done. arrrgh.

So.

Does anyone know how to make a macro-enabled workbook application operate normally if opened from an internet location? (it actually is opening from our intranet location)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Though I didn't get the solution for which I was searching, I will divide the points amongst you two for participating.  

Thanks.