LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
A J A J is offline
external usenet poster
 
Posts: 2
Default how to remove a reference from Excel project?

Well, I got something that did work. I changed

Set ref = Application.VBE.ActiveVBProject.References
to
Set ref = Application.VBE.VBProjects("MyProj").References

Where I renamed the default project name of VBAProject to
MyProj.

Now I can see my dll class, and I was able to remove it.
Whatever works, heh? I am still open for suggestions if
anyone has a better (or more correct) way to do this.

A J

-----Original Message-----
Hi All,

I have an Excel project where I make a reference to an
ActiveX dll class I wrote in VB6 on my workstation, but
that file is not installed on other workstations which
will use this Excel file. So I need to programmatically
remove the reference before shipping the Excel file off.
The purpose of the dll class is to collect data from an

MS
Access Application and pass it to this Excel file. This
works fine. But I need to remove the reference to my dll
class in the Excle File. Even though the dll class

passes
the data correctly to the Excel file, I can't detect it
with the following loop, and thus cannot remove it.

Dim v As Variant
For Each V in Application.VBE.ActiveVBProject.References
Debug.print v.Description
Next

This will correctly print out all the standard references
and even the reference to VBA Extensibility, but it won't
detect my ActiveX dll. In Access I can remove the
reference successfully as follows:

Dim ref As Reference
Set ref = References!MyRef
References.Remove MyRef

But this does not work in Excel. If anyone knows how I
can do this in Excel, I would be grateful if you could
share.

Thansk,
A J

.

 
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
Excel 2002 : How to remove the digits from original reference ? Mr. Low Excel Discussion (Misc queries) 6 April 13th 07 02:04 PM
remove name of addin in Tools menu: "Document Project" Kate Excel Discussion (Misc queries) 2 January 9th 07 06:50 PM
Remove previous file reference mkerstei Excel Discussion (Misc queries) 3 June 7th 06 04:13 PM
How do I remove a reference from a cell? stayathome working girl Excel Discussion (Misc queries) 1 April 18th 06 08:52 PM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 PM


All times are GMT +1. The time now is 09:38 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"