Error saving MS Excel Workbook in Vista

abduncan

Member
Joined
Mar 7, 2011
Messages
6
Programming Experience
Beginner
Hello,

I'm creating a program that exports data from an access database to MS Excel and using late-binding to allow for multiple versions of excel. When I try to execute the command xlWorkbook.SaveAs(path) in Vista, it throws an error:

"System.Runtime.InteropServices.COMException(0x800a03EC): Microsoft Excel cannot access the file 'C:\Program Files\MyProgram\CC9C2000'. There are several possible reasons: The file name or path does not exist. The file is being used by another program. The workbook you are trying to save has the same name as a currently open workbook."

I do not get this error in XP. I wondering if it has to do with the UAC? And if so, is there a way that my program can get around this without the end-user having to manaully make changes?
 
Last edited:
Okay, so I've manually turned off UAC and saving the excel workbook executes fine. Is there a practical way around this other than requiring the end-user to disable UAC?
 
Perhaps you can save a place that not requires admin rights?
 
Well, after some research, I believe I've answered my own question. I can either give my program administrator privileges, or do as you have suggests and save in a place that doesn't require administrative privileges. Thanks.
 
Back
Top