Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 31st, 2005, 08:03 AM
Authorized User
 
Join Date: Feb 2005
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object Library

Hi all,

I am having trouble with updating a reference to a DLL file programmatically. Let's call this file MYDLL.dll. I check whether MYDLL.dll is missing (i.e. IsBroken). If so, I try to remove it from the Object Library by using the

Thisworkbook.Vbproject.References.Remove (item) statement.

However, the item is still present in the Reference List(but now the tick box is unchecked). I now have multiple entries of MYDLL.dll, but how do I actually delete these items from the list?
My program should check whether the MYDLL.dll is broken, if so remove the reference (or delete it), and then add MYDLL.dll again using the AddFromFile statement.
No errors occur when running the code, but MYDLL.dll isn't updated with the new path I specified, it still uses the original path of the MYDLL.dll which I removed from the Object Libary.

I have been working on this problem for over a week now, but I think I am missing something fundamental. I am not sure whether this is my code, or my computer being the culprit, but any help would be appreciated!

-Max


Old post: http://p2p.wrox.com/topic.asp?TOPIC_ID=37933

 
Old January 2nd, 2006, 05:46 PM
Authorized User
 
Join Date: Feb 2005
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

For those who are interested:

All DLLs should export two functions— DllRegisterServer and DllUnregisterServer. They are used to register and unregister the ActiveX component in the Windows registry, and are usually invoked from regsvr32.exe at registration time.

You have to Un/Register them with the regsvr32.exe application.

Run it from the Windows Start > Run dialog.
regsvr32.exe full_path_and_file_MyDll.dll

Regsvr32.exe Usage
RegSvr32.exe has the following command-line options:
Regsvr32 [/u] [/n] [/i[:cmdline]] dllname

/u - Unregister server
/i - Call DllInstall passing it an optional [cmdline];
when used with /u calls dll uninstall
/n - do not call DllRegisterServer; this option must
be used with /i







Similar Threads
Thread Thread Starter Forum Replies Last Post
out look object library or redemptipn.dll pradeep29 .NET Framework 2.0 0 July 27th, 2007 10:56 PM
Excel 9.0 Object Library in C# .NET DanRoche General .NET 1 July 17th, 2007 09:28 AM
Object Library (VBA Excel), asking help here maxpotters Pro VB 6 0 December 31st, 2005 08:04 AM
InfoPath 2003 Object Library debsoft General .NET 2 April 30th, 2004 09:36 AM
How to get: Microsoft Forms 2.0 Object Library rstober Excel VBA 1 October 27th, 2003 08:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.