Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
About import / view of a excel file through VB..
Message
De
12/09/2000 03:03:54
 
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00412346
Message ID:
00415288
Vues:
26
Hi,

i've try and successful to use getobject function to get the data from excel file. But i must open excel before running this function , if not, error will occurs!

My coding:
' VpurBOM is a listbox
Dim pur_xls As Object
Set pur_xls = GetObject(VpurBOM.List(0))
pur_xls.Application.Visible = False
pur_xls.Parent.Windows(1).Visible = False

' test part
MsgBox pur_xls.Worksheets("sheet1").Range("A1").Value
' end test part

If findwindow("XLMAIN", 0) <> 0 Then
pur_xls.Application.Quit
End If

"findwindow" is a function use API to find whether excel program is running or not~!

Is that the problem i set the "application.visible = False" ?!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform