Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Worksheet SaveAs Problem
Message
De
23/12/2011 08:45:28
 
 
À
22/12/2011 22:32:08
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01531599
Message ID:
01531612
Vues:
55
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform