PDA

View Full Version : First Excel VBA program getting Run-Time error '48'



Zuccj
06-22-2017, 08:33 AM
This is the first VBA program in excel I've created, so I'm hoping I've just done something simple that is easy to correct. I'm creating a vba project with a 3rd party dll I was given. I'm just trying a simple function at the moment to ensure I can get it to work before programming the rest of it. I have that all made, and when I go to run it I'm getting an error. I've looked around some and from what I can tell the error usually means the dll needs another dll to work as well. The part that I don't understand is I made a super quick and simple c++ program and linked the dll to that, just to ensure that the dll was good, and that program ran just fine. For some reason when trying to use it in VBA it isn't working. I'm on Windows 10 and using Excel 13.

19572
The image above shows the function definition, where I'm pulling the dll in, along with the error code.

Edit: One thing I just noticed is that the dll is compiled as a 32-bit program, but I'm running it in a 64-bit program. I'm thinking that is the issue. Is there a way to make VBA a 32-bit program on a 64-bit computer?