Has the Excel 2003 OLE model changed over SPs?

D

Doug_F

I have some OLE code living in a non-MS db that opens an existing excel file,
pushes data into specific cells, computes a new file name and then saves off
the updated file with this new name.
The OLE save code looks like:
xlapp.activeworkbook.saveas filename
Where filename has been previously computed.
The format for this command is correct in the OLE environment I'm working in.

We have one user with a newly replaced PC running Excel 2003, no SP at all.
When the code gets to this step, it pops a message saying it can't find file
C:

I've run the code on this user's pc with a debugger on and the variable
FileName is correctly set to c:\MyComputedFN.xls

On PCs running 2003 SP2 and SP3, there are no problems.

I have no idea what SP this user was running before their old PC died.

The OLE/COM model changing makes not much sense to me, but I'm really
confused as to why this one user has this particular failure at the point the
file save is generated.

All of the rest of the code works as expected; Excel launches, a specific
file is opened, data is added, the file name generated...just won't save.

TIA for any tips.
 
D

dmoney

Not sure why, but I had a similar problem and excluding the application
seemed to work.

ActiveWorkbook.SaveAs Filename:= _
"C:\filename.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

HTH
 
D

Doug_F

Thanks. I have a request in to have the use updated to SP3. If that fixes
the problem, I'll probably not go any further. If he's still hosed, I'll
create a new version and leave off the 'xlapp.' bit and see what happens.

Doug
 
D

Doug_F

Found the problem and it has nothing to do with Excel's OLE API or my code.
Seems this user wasn't in the localdomainAdmin group on his PC so he had no
rights to save files onto his own C: drive...IT fixed the rights, code
magically starts working. Shazam!

Thanks for the reply.

Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top