Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27449

VS 2010 Force Excel to use updated version of DLL

$
0
0
((This is both a Visual Basic 2010 and an Excel 2010 question -- if it should be in the other forum, please move it & accept my apologies!))

I'm rewriting some parts of an existing project, and part of the rewrite is to move some sections of code out of VBA and into VB. The old project (which didn't use anything written in VB) was in Excel 2003, while the new work is all in Excel 2010 + Visual Studio 2010. Anyway, I have things to the point that Excel can call functions in the DLL & get meaningful data back. What I can't seem to make work is how to tell Excel that the DLL has changed, and to use the latest one, not what it was using before.

For instance, VBA calls a function in the DLL which returns a string with "VB code Version 5" in it. Then I update the code in Visual Basic to return "VB code Version 6", build the project, and I can see the "date modified" on the .dll and .tlb files change. And they seem to transfer over on DropBox okay. (I have Visual Studio on one machine, and Excel on another; the DLL is built to a particularly directory in DropBox, and the reference within VBA is to that location. Generally seems to work.) But when I run the routine in Excel, I'm still getting "Version 5" back.

Seems like I have been able to get things to update at times, but I don't know what I've done to cause it. Simply closing down & restarting Excel isn't enough. I've attempted to un-check then re-check the reference to the DLL in VBA IDE > Tools > References, but I get the error message "Can't remove the control or reference; in use" which makes sense, as it's called as soon as the workbook opens.

I'm sure there's got to be some simple "refresh" command that I should be seeing, but I'm stumped.

Any help much appreciated!

Viewing all articles
Browse latest Browse all 27449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>