Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation
Message
De
16/07/1999 13:26:55
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/07/1999 11:44:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00242078
Message ID:
00242433
Vues:
22
>>
uTMP = GetObject('ResulQAS12.XLS')
>>oXLSApp = createobject("Excel.application")
>>with oExcel
>>  .workbooks.open('ResulQAS12.XLS')
>>  .ActiveSheet.Range("A:D").EntireColumn.AutoFit
>>  .ActiveWorkbook.Save
>>  .Quit
>>endwith
If columns weren't adjacent then you could use either :
>>Range("A:A","F:F","P:Z") (if not coding internationally) or oExcel.Application.Union(.Range("A:A"),.range("F:F"),.range("P:Z"))
>>Cetin
>
>Hi Cetin
>
>Thanks for the tip. I think a line of code is missing where oExcel is asigned right before the WITH.
>
>I added:
> oExcel = uTMP.Application
>right before the WITH.
>I removed the CreateObject command as sugested on you next message.
>
>However the open does not work with or without full path.
>
>Does it works for you?
>
>Thanks and regards
>
>Oscar
Oscar,
W/o path it seeks the file in "My documents" folder. Otherwise you should provide full path taking spaces into consideritaion. Then it works. Just try this :
use (home()+"samples\data\customer")
lcFileName = sys(5)+curdir()+"myTest.xls"
copy to (lcFileName) type xls
oExcel= createobject("Excel.aplication")
with oExcel
  .WorkBooks.open(lcFileName)
  .visible = .t.
endwith
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform