Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Worksheet SaveAs Problem
Message
From
23/12/2011 08:45:28
 
 
To
22/12/2011 22:32:08
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01531599
Message ID:
01531612
Views:
56
Glad you got the problem solved, but perhaps a cleaner way of doing this would be
oExcel = CREATEOBJECT([Excel.Application])
oExcel.Visible = .t. 	
oWorkbook = oExcel.Workbooks.Add()	
oWorkbook.SaveAs(cxlsfile, xlNormal) 
oWorkbook.open(cxlsfile) 
Though I'm not sure you need that last .open command, but I haven't tested it, but doesn't the SaveAs leave the file open?


>Hi,
>
>The problem solve, I change the code to use oExcel.ActiveWorkbook.SaveAs
>instead of oExcel.Workbook.SaveAs
>
>
>oExcel = CREATEOBJECT([Excel.Application])
>oExcel.Visible = .t. 	
>oWorkbook = oExcel.Workbooks.Add()	
>oWorkbook = oExcel.ActiveWorkbook.SaveAs(cxlsfile, xlNormal) 
>oWorkbook = oExcel.Workbooks.open(cxlsfile) 
>
>
>Thanks.
>Derek
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Reply
Map
View

Click here to load this message in the networking platform