Excel CheckBox help

wbenhart

New Member
Hello everyone,

I was looking for some help with programaticaly changing the CheckBox's in an excel program. I've looked at the com viewer for help, but couldn't quite understand it.

Here is what I've tried:

Code:
DEFINE VARIABLE chExcel AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chWorkBook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE chWorkSheet AS COM-HANDLE NO-UNDO.
 
CREATE 'Excel.Application' chExcel NO-ERROR.
chExcel:VISIBLE = TRUE. /* this will show you the excel spread sheet */
chExcel:DisplayAlerts = FALSE.
chWorkBook = chExcel:WorkBooks:OPEN("C:\DLC\Programs\Excel\8130-3.xls").
chExcel:Sheets('sheet1'):SELECT. /* Sheet name */
chWorkSheet = chExcel:Sheets('sheet1'). /* Sheet name */
 
 
chExcel:CheckBox:SELECT = "CheckBox3".
chExcel:CheckBox:VALUE = TRUE.
 
 
/* chExcel:Quit(). */
RELEASE OBJECT chWorkSheet.
RELEASE OBJECT chWorkBook.
RELEASE OBJECT chExcel.
Does anyone have any idea on how to make these work?

Thank you,

Wayne Benhart
 
Back
Top