Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Checkbox
#1
I have an excel spreadsheet that has 2 checkboxes on it. QM asks a yes no question. Depending on the answer I want one of the checkbox filled in. Can I do this?

Thanks as always.
#2
I finally have a sample of what I want to to in VBA, since the checkbox is an active X box I know there has to be a way to use QM to manipulate it. Here is the VBA code I have working:

Select Case Sheet1.cb1.Value
Case True
MsgBox "true"
Case False
MsgBox "false"
End Select
Sheet1.cb1.Value = "False"

The last line is really what I want to do. How do I do this in QM?

Thanks!
#3
You can run Excel macros from QM. Example:

QM
Code:
Copy      Help
typelib Excel {00020813-0000-0000-C000-000000000046} 1.2 0 1
Excel.Application a._getactive; err act; act; a._getactive

word bChecked=TRUE
a.Run("Macro1" bChecked)

Excel
Code:
Copy      Help
Sub Macro1(ByVal bCheck As Boolean)
MsgBox bCheck
End Sub
#4
Thank you. But I am not trying to run an Excel macro from QM, but replace it. I actually have about 50 (or more) checkboxes I am trying to fill in automatically and would rather do it from QM then Excel.

Thanks again.
#5
Actually this will work. I will need to pass a variable to Excel and then it will work.

Thanks
#6
The same in QM:

Code:
Copy      Help
typelib Excel {00020813-0000-0000-C000-000000000046} 1.2 0 1
Excel.Application a._getactive; err act; act; a._getactive
IDispatch ws=a.ActiveSheet

int v=ws.CheckBox1.Value
sel v
,case -1 mes "True"
,case 0 mes "False"
ws.CheckBox1.Value=0 ;;can be 0 or 1 or 2


Forum Jump:


Users browsing this thread: 1 Guest(s)