shimon
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 10/26/2010
-
Status: offline
|
Add a check box to an excel spreadsheet using VB Script
Tuesday, October 26, 2010 8:06 AM
( permalink)
Hello, I have a script that creates a Excel file, I wanted to add a check box to on of the cells. I get an error message: Error: Wrong number of arguments or invalid property assignment: 'Left' Code: 800A01C2 From this code: [xlBook.ActiveSheet.OLEObjects.Add ClassType="Forms.CheckBox.1", Link=False, _ DisplayAsIcon=False, Left=Range("A1").Left, _ Top=Range("A1").Top, Width=108, Height=19.5[/code] [[<font][<font]Best Regards
|
|
|
|
ehvbs
-
Total Posts
:
3320
- Scores: 112
-
Reward points
:
0
- Joined: 6/22/2005
- Location: Germany
-
Status: offline
|
Re:Add a check box to an excel spreadsheet using VB Script
Tuesday, October 26, 2010 8:25 AM
( permalink)
You can't use named arguments (like ClassType:="...") in VBScript; replace them with positional ones. (BTW: Thank you for this "useful" "completed VBScript")
|
|
|
|
shimon
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 10/26/2010
-
Status: offline
|
Re:Add a check box to an excel spreadsheet using VB Script
Wednesday, October 27, 2010 5:06 AM
( permalink)
ehvbs You can't use named arguments (like ClassType:="...") in VBScript; replace them with positional ones. (BTW: Thank you for this "useful" "completed VBScript") e Thank you so much For point me in the right direction. Here is the working Code: [ xlBook.ActiveSheet.OLEObjects.Add "Forms.CheckBox.1" With xlBook.ActiveSheet.OLEObjects .Left = 50 .Top = 10 .Width = 100 .Height = 15 End with [/code] [
|
|
|
|
shimon
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 10/26/2010
-
Status: offline
|
Re:Add a check box to an excel spreadsheet using VB Script
Wednesday, October 27, 2010 5:09 AM
( permalink)
to EHVBS Both days my comments were cut off after I entered the Code, I also added Thank you I appreciate your input and support. Best regards,
|
|
|
|