BrianExcel
Well-known Member
- Joined
- Apr 21, 2010
- Messages
- 975
I am using an add-in with saved subs to run code. The subs are being run from the ribbon. When i try the following code:
MsgBox ThisWorkbook.ActiveSheet
I get an error: "Run-Time error 91. Object variable or with block variable not set."
I have the 'control as iRibbonControl' correctly inserted to call the ribbon.
Why won't this work?
(FYI, even though I add new worksheets via the previous sub (which all works fine), the worksheets don't actually appear in the workbook. It just shows "sheet1" and "thisworkbook" with no additional sheets....
MsgBox ThisWorkbook.ActiveSheet
I get an error: "Run-Time error 91. Object variable or with block variable not set."
I have the 'control as iRibbonControl' correctly inserted to call the ribbon.
Why won't this work?
(FYI, even though I add new worksheets via the previous sub (which all works fine), the worksheets don't actually appear in the workbook. It just shows "sheet1" and "thisworkbook" with no additional sheets....