Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLECONTROL - Excel sheet

Status
Not open for further replies.

raspoutine

Programmer
Sep 28, 2001
13
FR
On my screen I have an open Excel sheet which is updated automatically.
My Foxpro application (Ver 6.0) save into a database informations of this Excel sheet every 5 minutes.

I used the following instructions on my form to link the Excel sheet


THISFORM.ADDOBJECT("oExcel","OleXLSheet")

WITH THISFORM.OEXCEL
VA = .WORKSHEETS(1).CELLS(10,1).VALUE
VB = .WORKSHEETS(1).CELLS(11,1).VALUE
ENDWITH




Define class OleXLSheet as OLECONTROL
Oleclass = "Feuille.Excel"
documentfile = 'c:\MUN\WEBSHEET.XLS'
oletypeallowed = 0
ENDDEFINE


The problem is the following:
When I start the program, I always have the screen which invite me to choose the object to link.
However the address of the sheet is defined in the class (documentfile = ‘c:\Mun\WEBSHEET.XLS’)

Second question : How to define the adress of the excel sheet with variable ?

Thanks for help me.

Sorry for my English

 
Can you make that procedure a method in your class and pass it in as a parameter.

Run this snippet to see what I mean.

x=CREATEOBJECT('capp')
x.sayHello("Jim")

DEFINE CLASS capp AS container
*-- Contains the name of the user.
username = "Sammy Sample"

PROCEDURE sayHello
LPARAMETERS tcName
MESSAGEBOX("Hello " + tcName,0,"MyClass")
ENDPROC
ENDDEFINE

Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top