Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Beginner question on OLE call
Message
From
15/05/2000 10:55:50
 
 
To
15/05/2000 10:51:08
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00369596
Message ID:
00369605
Views:
14
Try:

You can get information from the Excel VBA help file. You could also try recording a macro in Excel and then looking at the VBA code it creates.

I don't think you can open just the spreadsheet without opening Excel.

FYI, you can pre-order Hentzenwerke's Office Automation with VFP book at www.hentzenwerke.com.


>Hello to All,
>
>I'm doing my first experimentation with OLE and up to now it's not a success :-(
>
>I tough I first try with basic command I foud in VFP help but even those don't seems to work for me. Here's what I found in help and tried:
>
>First trial:
>"For example, to create a Microsoft Excel worksheet (which supports Automation), you can use the following syntax:
>
>x = CREATEOBJECT('Excel.Sheet')
>
>When this code is run, Microsoft Excel is started (if not already running), and a new worksheet is created."
>
>This couldn't be simplier right? but when I tried it, Excell is not started. No error, nothing, I even check type("x") which return "O" so the object is created!
>
>Second trial:
>So I found also this in vpf help which I also tried without success.
>oleApp = GETOBJECT(, "Excel.Application")
>
>Third trial:
>I got this code from a UT user sometime last week. This works, Excell is open with the good spreedsheet.
>objExcel= CREATEOBJECT("Excel.Application")
>lcFile = "C:\Temp\Stock\Info.xls"
>objBook = objExcel.WorkBooks.Open(lcFile)
>objExcel.Visible = .t.
>
>Althrough this code works, I understand only part of it, where can I found information on "Excell" properties or method like .WorkBooks.Open()? I suppose that other interresting method exist, where or how can I see them?
>
>One thing I'm trying to accheive is to open Excell only if it's not running, otherwise, I would like to open the spreedsheet only.
>
>
>
>
>BTW: I'm using VFP 6.0, and Ecxell 97.
>
>
>Note: I applogize for such a long question, If somebody feels like ansewring only part of it, feel free.
>
>TIA
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform