Link to home
Start Free TrialLog in
Avatar of BMIT
BMIT

asked on

MS Excel SaveAs Without Prompt, VBA MS Access

Hello,

I have the following code at the end of a function that edits an Excel spreadsheet within an Access code, VBA:

apExcel.DisplayAlerts = False
    wkBook.SaveAs FileName:=sFileName
apExcel.DisplayAlerts = True

Supposedly, this should save the file without any prompts.  Strangely, it seems to save the file, the prompt again if I want to save the prompt.  I recently upgraded from Access and Excel 2000 to 2010, and this code worked fine with those.  However, everything I read says this should work.

Anyone have any ideas?

Thanks,

ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America 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
Avatar of BMIT
BMIT

ASKER

"Another possibility is that you try to close the workbook and encounter the Save prompt from that action. You can avoid it with the SaveChanges parameter:
wkBook.Close SaveChanges:=False"

You hit the nail on the head.  This fixed the issue.

Thanks.