LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Reference Error

VJ

Not sure I understand the situation exactly, but I think ThisWorkbook may
need changing to ActiveWorkbook.
ThisWorkbook applies to the add-in, but as I understand it you want to
install the library in the active workbook.

RBS


"VJ" wrote in message
...
I have written a module which copy the code from ModuleA to ModuleB using

reference to "Microsoft Visual Basic for Application Extensibility 5.3".

Code works fine If i use in only one workbook.

But If I use same code in my addIn, which basically copy the code from one

module in the addIn to the client workbook, It throws error and closes
everything.

The Error I get is: "Microsoft has encountered error.......Click close btn

to close.... and after that it closes everything.

I am also setting reference using the following code.

For Each REF In ThisWorkbook.VBProject.References
'Debug.Print ref.Name, ref.GUID, ref.Major, ref.Minor
If REF.name = "VBIDE" Then blnRefFound = True: Exit For
Next
'If reference is not checked, then check it by setting the values

in the registry
If blnRefFound = False Then
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{0002E157-0000-0000-C000-000000000046}", _
Major:=5, Minor:=3
End If


Can somebody pls help me out?



 
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
#N/A Error Reference Sergio Excel Worksheet Functions 2 November 2nd 09 06:09 PM
Circular Reference error... Regnab Excel Discussion (Misc queries) 0 May 22nd 06 01:23 PM
reference #value error DrXerox Excel Worksheet Functions 0 July 22nd 05 03:56 AM
Workbook reference error R Avery Excel Programming 3 April 14th 04 01:57 PM
VBA reference error Thor[_2_] Excel Programming 1 January 7th 04 09:46 PM


All times are GMT +1. The time now is 04:20 PM.

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"