Information générale
Catégorie:
COM/DCOM et OLE Automation
Thank you Sergey. You always seem to come through on my Excel issues. :)
The code you referenced...
PROCEDURE iCheckboxes
oExcel= getOBJECT(,"Excel.Application")
with oExcel.ActiveSheet
* assuming they were added from control toolbar
FOR ia=1 to .oleobjects.Count
WITH .oleobjects.Item(ia)
if "checkbox"$LOWER(.name)
.Object.value=.t. &&check it
endif
ENDWITH
ENDFOR
endwith
oExcel.Quit()
oExcel=null
RETURN
....when it reaches the "FOR" part it immediately jumps to "ENDFOR".
I'm checking the value of a field in my table...
If FILE.FIELD > 0
(this is where I want it to check a box)
This code dates back maybe 10 years and you'll notice has your name in it, for other things you've helped me with.
The code I'm using to call Excel is...
oleApp = CREATEOBJECT("Excel.Application") && Start Excel.
oleApp.DisplayAlerts=.F. &&GO SERGEY!!!!!!!!!
**THEN A BUNCH OF CODE TO CREATE FILENAME
If FILE(m.newfile)
**THEN A BUNCH OF CODE TO ALLOW USER TO SELECT DIFFERENT FILENAME OR ADD TO EXISTING
m.FILENAME=LEFT(NAME,LEN(NAME)-0)
oleApp.Workbooks.OPEN(m.newfile)
oleApp.Workbooks.OPEN(M.dir+"REPORTS\REPORTFORM.xls")
**THEN A BUNCH OF CODE TO CREATE THE WORKSHEET NAME
oleApp.Sheets("master").SELECT
Wait CLEAR
oleApp.Sheets("master").SELECT &&OK
oleApp.Sheets("master").NAME = ALLTRIM(m.newworksheet)
...I will have 12 different checkboxes based on varying conditions.
Can you please provide a little more insight into what the code you referenced is doing?
Thanks so much,
Martha
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement