Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy To excel question
Message
De
11/01/2006 09:03:38
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Import/Export
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01085186
Message ID:
01085592
Vues:
16
Sorry, that probably should be ExcelA instead of ExcelW.

Here is an example from VFP showing two different techniques:

LOCAL ExcelA, ExcelW
ExcelA = CREATEOBJECT('Excel.Application')
ExcelW = ExcelA.Application.Workbooks.Open("C:\book1.xls")

* one method is to just autofit all columns
ExcelA.Columns.EntireColumn.AutoFit()

* another method is to select the columns, then autofit the selection
ExcelA.Cells.Select()
ExcelA.Selection.Columns.AutoFit()

ExcelA.DisplayAlerts = .f.
ExcelA.SaveWorkspace()
ExcelA.Application.Workbooks.Close()
ExcelW= NULL
ExcelA= NULL


Note that if you want to figure out the commands to do something like this in Excel, you can record your actions using Tools>Macros>Record new Macro and then view the commands using Tools>Macros>Visual Basic Editor.



>Thanks Mark,
>
> Are you sure the code is correct. I am getting error saying 'Object doesnot support this propert ExcelW.Columns.'
>
>Bharat
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform