Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VB Object Help???
Message
 
À
23/07/1998 18:55:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00120777
Message ID:
00120966
Vues:
13
I'm not much of a VB programmer, but it looks like your missing the workbooks object in your reference. Try:

xl.application.workbooks.open "c:\test.xls" 'valid file name

Tip: Whenever I'm having trouble with Office Automation, I go into the Office app and record a macro to do what it is I need to do, then look at the VB Script in the macro.


>Can someone tell me what is causing my open file code to fail with the error ' invalid object reference'
>
>Private Sub Command1_Click()
> Dim xl As Object
>
> Set xl = CreateObject("Excel.Sheet")
>
> xl.application.Visible = True
> xl.application.open "c:\test.xls" 'valid file name
> xl.Open "c:\temp.csv"
>
>
> Set xl = Nothing
>End Sub
>
>
>Thank you
kenweber
GCom2 Solutions
Microsoft Certified Professional

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform