I run the RowRangeForm macro (below) from within another Excel macro, both in Module1 of my VBAProject (Personal.XLSB). The form macro works fine but the VBA Editor remains showing the Userform pane instead of switching back to the active Module1 pane. I want Module1 and Procedure that called the form to stay visible in the VBA Editor.
I tried using this:
ThisWorkbook.VBProject.VBE.ActiveCodePane.Show
But that gave this error message: "Run-time error '1004": Programmatic access to Visual Basic Project is not trusted"
Here's my code:
Sub RowRangeForm()
RowRange.Show
RowStartValue = RowRange.RowStart.Value
RowEndValue = RowRange.RowEnd.Value
Unload RowRange
ThisWorkbook.VBProject.VBE.ActiveCodePane.Show 'gets the "not trusted" error.
End Sub
I've also tried a couple different ways but can't get it to work...probably needs the object set/defined correctly? Any suggestions appreciated!
--Ray
I tried using this:
ThisWorkbook.VBProject.VBE.ActiveCodePane.Show
But that gave this error message: "Run-time error '1004": Programmatic access to Visual Basic Project is not trusted"
Here's my code:
Sub RowRangeForm()
RowRange.Show
RowStartValue = RowRange.RowStart.Value
RowEndValue = RowRange.RowEnd.Value
Unload RowRange
ThisWorkbook.VBProject.VBE.ActiveCodePane.Show 'gets the "not trusted" error.
End Sub
I've also tried a couple different ways but can't get it to work...probably needs the object set/defined correctly? Any suggestions appreciated!
--Ray