Handle Excel Errors in Access

S

swedbera

Is there a way to handle an Excel generated error from within VBA in Access?
I have written a procedure that prompts the user to overwrite and existing
Excel file. If the user chooses Cancel, they get the following error:

SaveAs Method of Workbook class failed. Error 1004. Microsoft Excel

I didn't see any similar posts, so any suggestions would be appreciated.

Thanks,

Arlene
 
J

John Nurick

Hi Arlene,

If I understand right, you're automating Excel from Access. In that case,
ordinary VBA error handling should catch errors raised by your Excel
objects.
 
S

swedbera

So I thought too. I always add select statements to my code to catch errors
that I know might occur and an Else Statement for all other unknown errors -
it did not work in this case.
 
J

John Nurick

If you post the code in question, with an indication of which statement
raises the error, someone may be able to spot the problem.
 
Top