Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
max max is offline
external usenet poster
 
Posts: 4
Default VBA Integrated Development Environment basic question

Hi

I'm reading "Excel 2000 power programming with vba" by Walkenbach, in
the 27th chapter he mentions that by adding a reference to Microsoft
Visual Basic for Applications Extensibility in a VBA Project a
programmer can have access to all the VB Editor's objects, properties
and methods.
Now I added a reference (tools,References in VBE) to the Microsoft
Visual basic for Applications Extensibility 5.3 for a new workbook and
then wrote this code :

Sub ListReferences()
Dim ref As Reference, msg As String
msg = ""
For Each ref In ActiveWorkbook.VBProject.References
msg = msg & ref.Name & vbCrLf
Next ref
MsgBox msg
End Sub

but when I try it I get an error (run time error 1004) as it can't
resolve ActiveWorkbook.VBProject.
Is the Microsoft Visual basic for Applications Extensibility 5.3 the
right reference to add?
I'm on Excel 2002.

Regards.

Massimo.
Bye
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VBA Integrated Development Environment basic question

Max,
That is the correct library, but each workbook has its own reference list.
There is a possibility that when you added it, you added it to a different
workbook than the one where you have this code. The reference is added to
the active project, so select the workbook with this code in the Project
explorer, then do tools=References and see if you have the reference to the
extensibility library. If not, then add it there.

--
Regards,
Tom Ogilvy

"max" wrote in message
...
Hi

I'm reading "Excel 2000 power programming with vba" by Walkenbach, in
the 27th chapter he mentions that by adding a reference to Microsoft
Visual Basic for Applications Extensibility in a VBA Project a
programmer can have access to all the VB Editor's objects, properties
and methods.
Now I added a reference (tools,References in VBE) to the Microsoft
Visual basic for Applications Extensibility 5.3 for a new workbook and
then wrote this code :

Sub ListReferences()
Dim ref As Reference, msg As String
msg = ""
For Each ref In ActiveWorkbook.VBProject.References
msg = msg & ref.Name & vbCrLf
Next ref
MsgBox msg
End Sub

but when I try it I get an error (run time error 1004) as it can't
resolve ActiveWorkbook.VBProject.
Is the Microsoft Visual basic for Applications Extensibility 5.3 the
right reference to add?
I'm on Excel 2002.

Regards.

Massimo.
Bye



  #3   Report Post  
Posted to microsoft.public.excel.programming
max max is offline
external usenet poster
 
Posts: 4
Default VBA Integrated Development Environment basic question

On Mon, 26 Jul 2004 10:01:55 -0400, "Tom Ogilvy"
wrote:

Max,
That is the correct library, but each workbook has its own reference list.
There is a possibility that when you added it, you added it to a different
workbook than the one where you have this code. The reference is added to
the active project, so select the workbook with this code in the Project
explorer, then do tools=References and see if you have the reference to the
extensibility library. If not, then add it there.


Tom

first thanks for answering, I'm sure I added it to the right project
because it's the only open project and can also see it in its
references window (it was moved up within the loaded references) so
that should not be the problem.
But It doesn't work.

Massimo.
Bye
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA Integrated Development Environment basic question

Your code should work fine. However, if access to the VBProject
is not trusted, the code will fail. In Excel, go to the Tools
menu, choose Macros, then Security, then the Trusted Publishers
tab. There, ensure that "Trust Access To Visual Basic Project" is
checked.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





"max" wrote in message
...
Hi

I'm reading "Excel 2000 power programming with vba" by

Walkenbach, in
the 27th chapter he mentions that by adding a reference to

Microsoft
Visual Basic for Applications Extensibility in a VBA Project a
programmer can have access to all the VB Editor's objects,

properties
and methods.
Now I added a reference (tools,References in VBE) to the

Microsoft
Visual basic for Applications Extensibility 5.3 for a new

workbook and
then wrote this code :

Sub ListReferences()
Dim ref As Reference, msg As String
msg = ""
For Each ref In ActiveWorkbook.VBProject.References
msg = msg & ref.Name & vbCrLf
Next ref
MsgBox msg
End Sub

but when I try it I get an error (run time error 1004) as it

can't
resolve ActiveWorkbook.VBProject.
Is the Microsoft Visual basic for Applications Extensibility

5.3 the
right reference to add?
I'm on Excel 2002.

Regards.

Massimo.
Bye



  #5   Report Post  
Posted to microsoft.public.excel.programming
max max is offline
external usenet poster
 
Posts: 4
Default VBA Integrated Development Environment basic question

On Mon, 26 Jul 2004 09:06:40 -0500, "Chip Pearson"
wrote:

Your code should work fine. However, if access to the VBProject
is not trusted, the code will fail. In Excel, go to the Tools
menu, choose Macros, then Security, then the Trusted Publishers
tab. There, ensure that "Trust Access To Visual Basic Project" is
checked.


Chip

It worked nicely.

Thanks a lot and have a good day.

Massimo.

Bye


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
how do i get the sage integrated reporting toolbar on excel? feecam Excel Discussion (Misc queries) 4 December 4th 09 12:03 PM
Work schedule development question edju Excel Discussion (Misc queries) 4 September 16th 06 01:21 PM
Email Integrated to Excel Bob Ogdon Excel Discussion (Misc queries) 0 August 21st 06 12:45 PM
Excel 2000 microsoft development environment Ben[_5_] Excel Programming 1 December 13th 03 05:52 PM
Any Development environment for Office 2002/2003 Von Shean Excel Programming 1 November 28th 03 05:05 PM


All times are GMT +1. The time now is 05:33 AM.

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

About Us

"It's about Microsoft Excel"