Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to save Excel Worksheet?
Message
De
10/03/2010 21:04:19
 
 
À
10/03/2010 09:39:03
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 SP2
Divers
Thread ID:
01453718
Message ID:
01453851
Vues:
54
This works for me - although may not want to do the "AutoFit" for all the columns:
IF FILE( "mySheet.xlsx" )
    ERASE( "mySheet.xlsx" )
ENDIF
WITH This.oExcel
    .Cells.Select                            && Select the entire worksheet
    .Selection.Columns.AutoFit               && AutoFit columns to whatever width is required
    .ActiveWorkBook.SaveAs( "mySheet.xlsx")  && Save the worksheet as default for Excel 2007
    .Quit()                                  && shutdown Excel
    RELEASE oExcel                           && Release the Excel.Application object
ENDWITH  
>Hi friends:
>
>I add an Excel object and everything works well but I'd like to allow my client to "save as" with a suggested name.
>
>I tried oExcel.workbook.save("My name") and an error "Invalid number of parameters" or so.
>
>I tried oExcel.workbook.saveas("My Name") and an Excel file is saved as "My Name" but I want the user to be able to change it.
>
>Can anyone dissipate the haze of my ignorance?
>
>Thank you
>
> Héctor
Scott Ramey
BDS Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform