Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel worksheets in VFP6
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00316031
Message ID:
00316099
Views:
19
>Hi, could someone please help. I am using the code below to open an Excel worksheet in a Foxpro v6 application. From the command window I don't have a problem, but when I compile the app, the Excel worksheet momentarily displays and then diappears. What am I doing wrong? Any help would be appreciated.
>
>** code being used
>gfile=getfile("xls")
>
>If !empty(gfile)
> oleApp = createobject("Excel.Sheet")
> oExcel=oleApp.Application
> oExcel.Workbooks.Add(gfile)
> oleApp=getobject(,"Excel.Application")
> oleApp.Application.visible=.t.
>Endif

Getobject() quit working for me in vfp6 also. Do something like this:

oExcel = createobject("Excel.Sheet")
oExcel.Workbooks.Add(gfile)
oExcel.Visible = .t.

You may need to make oExcel a form property, and use a local like oSheet as:

oSheet = Thisform.oExcel.Activesheet

to manipulate it.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Reply
Map
View

Click here to load this message in the networking platform