M
Mark Tangard
OK, so I edit my VBA a lot. In Word, I made sneaky macros to
quickly open my add-ins, etc., in the VBA editor and display
specific code modules. Now that I'm soaking in Excel, I tried
the same sort of code, and it SORT OF works:
Sub EditMT()
Dim w As Workbook
Set w = Workbooks.Open(Filename:="C:\Path\MTstuff.XLS")
w.VBProject.VBComponents("Module1").CodeModule.CodePane.Show
End Sub
Now, what would cause this to show a totally different VBA
project the *first* time it's run during an Excel session.
(Typically it shows the project that's alphabetically first
in the project explorer, if that means anything). It works
properly for the rest of the session. (Of course, the first
time tends to be when I want it open most urgently!)
I have 4 custom buttons to open different projects, and they
misbehave identically, so it's not related to the file being
opened.
TIA
quickly open my add-ins, etc., in the VBA editor and display
specific code modules. Now that I'm soaking in Excel, I tried
the same sort of code, and it SORT OF works:
Sub EditMT()
Dim w As Workbook
Set w = Workbooks.Open(Filename:="C:\Path\MTstuff.XLS")
w.VBProject.VBComponents("Module1").CodeModule.CodePane.Show
End Sub
Now, what would cause this to show a totally different VBA
project the *first* time it's run during an Excel session.
(Typically it shows the project that's alphabetically first
in the project explorer, if that means anything). It works
properly for the rest of the session. (Of course, the first
time tends to be when I want it open most urgently!)
I have 4 custom buttons to open different projects, and they
misbehave identically, so it's not related to the file being
opened.
TIA