Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Accessing VBProject Property
Help!
I have a very simple subroutine to get me a list of macros in the current excel workbook. When the code runs I get a runtime error as follows: VBProject <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred Microsoft.Vbe.Interop.VBProject The code is listed below. Any ideas? I am running the code under Visual Studio. Peter Sub ListModules() Dim VBComp As Microsoft.Vbe.Interop.VBComponent Dim Msg As String Dim wb As Excel.Workbook wb = m_ThisApplication.ActiveWorkbook For Each VBComp In m_ThisApplication.ActiveWorkbook.VBProject.VBCompo nents ......... Next VBComp MsgBox(Msg) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Accessing VBProject Property
What is the security setting in excel/the workbook. Is programmatic access
granted to the VBE? Is the project unprotected? -- Regards, Tom Ogilvy "Peter" wrote in message ... Help! I have a very simple subroutine to get me a list of macros in the current excel workbook. When the code runs I get a runtime error as follows: VBProject <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred Microsoft.Vbe.Interop.VBProject The code is listed below. Any ideas? I am running the code under Visual Studio. Peter Sub ListModules() Dim VBComp As Microsoft.Vbe.Interop.VBComponent Dim Msg As String Dim wb As Excel.Workbook wb = m_ThisApplication.ActiveWorkbook For Each VBComp In m_ThisApplication.ActiveWorkbook.VBProject.VBCompo nents ........ Next VBComp MsgBox(Msg) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error accessing external object property XVALUES | Excel Discussion (Misc queries) | |||
Error accessing external object property vbe | Excel Programming | |||
Unprotecting the VBProject | Excel Programming | |||
Documentation for VBProject | Excel Programming | |||
VBProject events? | Excel Programming |