Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Office 2007 problem
Message
De
15/01/2009 14:59:01
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01374126
Message ID:
01374174
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>Sorry for starting a new thread with the problem.
>>>
>>>I have this code
>>>
>>>
>>>IF '12' $ loExcel.VERSION && XL 2007
>>>		* Kevin Delaney's suggestion
>>>		loExcel.SAVEAS(tcXLSFileName, 39) && 39
>>>	* Cetin Basoz suggestion
>>>		loExcel.ActiveWorkbook.Saved = .T.
>>>		loExcel.ActiveWorkbook.CLOSE(0)		
>>>	ELSE
>>>		loExcel.SAVE()
>>>	ENDIF
>>>
>>>and it gives me an error "Unknown name"
>>>
>>>Commenting out SaveAs line doesn't save my formatting.
>>>
>>>What can we do in Office 2007?
>>>
>>>Thanks a lot in advance.
>>
>>You can't save Excel :-)
>>You must save WorkBook:
>>
>>LOCAL loExcel AS Excel.Application
>>loExcel = CREATEOBJECT([Excel.Application])
>>loExcel.WorkBooks.Add()
>>tcXLSFileName = [c:\test.xlsx]
>>IF '12' $ loExcel.VERSION && XL 2007
>>   * Kevin Delaney's suggestion
>>   loExcel.ActiveWorkbook.SAVEAS(tcXLSFileName, 39) && 39
>>    * Cetin Basoz suggestion
>>   loExcel.ActiveWorkbook.Saved = .T.
>>   loExcel.ActiveWorkbook.CLOSE(0)        
>>ELSE
>>    loExcel.SAVE()
>>ENDIF
>>
>
>Can not believe I was that blind! But I can not test at the moment.


I did :-)
And it works for me.
One thing, when you save the file with 2007 format and you pass extention, just make sure that it is XLSX.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform