VB6 Dll, VBA and Windows 7??

M

Messenger

Hey All,

I went to load a VB6 .dll and all I received was a generic "Error Loading
DLL" message. I then created a simple VB6 dll for testing and it does not
show up under the list of references available from within VBA.

I am running Windows 7 Pro and Office 2007.

Any ideas?

Thanks
 
K

Ken Slovak

Is this Office 2007 64-bit? If so no 32-bit code will run with it, including
anything VB6.
 
K

Ken Slovak

What about registration? Does the DLL need to be registered? I've had
problems running regsvr32 on VB6 dll's from the UI although any installers
I've made have been able to register my VB6 dll's.

How are you trying to load the dll? I've been using LoadLibrary() with no
problems.
 
M

Messenger

Hey Ken,

This is in debug mode (i.e. from within VB6). I run the .dll and then try
to work with it.

What's stranger, after stopping and starting various Office apps and VB6, a
dummy .dll that I was working with now shows up where before it did not.
Very strange.

However, my legacy .dll that I was working with will not work but if I
compile it, I can register it as a reference from within VBA. Very strange.

My next step is to add the various project references to my dummy .dll to
see if it gives me load errors.

Regards,

-- TC
 
M

Messenger

This issue had to do with compatibility. Running the MS Office apps with XP
compatibility solved the issue. There are a couple of ways to do this.

This can be set from the Control Panel under System and Security ->
Troubleshoot computer problems -> and under Programs choose "Run programs
for previous versions of windows". Make sure to click "Advanced" and choose
"Run as Administrator", click "Next" and it will give you a list of apps.

However, to me, it is far simpler to do it the second way.

Find the folder where the application resides. Right click and select
"Properties", select the 'Compatibility' tab and select the 'Compatibility
Mode'.

However, setting this to XP compatibility does create some other issues
which, at this time, Microsoft has noted as a bug. If you double click and
Office document, such as a Word document, for example, you will receive an
error "There was a problem sending the command to the program" and the
document will not open. You will need to open this via the File -> Open
dialog. This has to do with compatibility between Explorer.exe and the
Office app.

I have not tried fiddling with Explorer.exe yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top