Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel 95 and Excel 97
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Excel 95 and Excel 97
Divers
Thread ID:
00119124
Message ID:
00119124
Vues:
57
I have a view which I have copied to an XL-file with "COPY to myxl TYPE XL5". I want to clean it up, adjusting columns, change the headers and so on. I have tried to use OLE which works nice but.... when I'm closing the XL-file , I get that annoying "This file was created in another format than Excel97. Do you want to change it to Excel97" or something like that (I am using Swedish version of Office 97).

My code looks like this:

objExcel = CreateObject("Excel.Application")
cFileName = sys(5)+curdir()+alltrim(report_header)+".xls"
objBook = objExcel.WorkBooks.Open(cFileName)
...
some code
...
objBook.Saveas(cFilename)
objBook.Close(.f.)
objExcel.Quit

I can solve the problem if I change the filename when I save the file and then I delete the original file and rename the new. According to the Helpfile in Excel you might have a parmeter xlNormal to save the file in the correct format to avoid the upgradequestion. How do I use it?

/Pierre Unge, Sweden
------------- if you cut here, you'll probably destroy your monitor ------------
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform