ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Has the Excel 2003 OLE model changed over SPs? (https://www.excelbanter.com/excel-programming/413145-has-excel-2003-ole-model-changed-over-sps.html)

Doug_F

Has the Excel 2003 OLE model changed over SPs?
 
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.

DMoney

Has the Excel 2003 OLE model changed over SPs?
 
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
"Doug_F" wrote:

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.


Doug_F

Has the Excel 2003 OLE model changed over SPs?
 
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

"dmoney" wrote:

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


Doug_F

Has the Excel 2003 OLE model changed over SPs?
 
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

"Doug_F" wrote:

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.



All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com