Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error accessing external object property XVALUES sergio Excel Discussion (Misc queries) 2 February 7th 07 04:47 PM
Error accessing external object property vbe NilovSerge Excel Programming 1 June 21st 04 12:48 PM
Unprotecting the VBProject jstrater Excel Programming 4 May 16th 04 04:01 PM
Documentation for VBProject Wes Jester Excel Programming 2 September 30th 03 06:26 PM
VBProject events? Marc R. Bertrand Excel Programming 1 September 14th 03 04:12 PM


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"