Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
About import / view of a excel file through VB..
Message
 
To
12/09/2000 03:03:54
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00412346
Message ID:
00415349
Views:
21
>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" ?!

I don't have this problem! When I try your code snippet, Excel is launched with the workbook inside. I have now Excel 97.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform