"Error in loading DLL" on Vista

I have an excel file with VB macros that requires the "winhttp" service in order to publish certain results. The file was created using Excel 97. The first time you run it on a system, you obtain compile errors which are easily resolved by enabling the "Microsoft WinHTTP Services, vesion 5.1" reference in the VB debugger. The program works without issues once this is done.

The program runs on WinXP SP2 running Office 2003 and Office 2007 after the winHTTP service has been enabled. However, on a Vista machine running Office 2007, the path to the winhttp.dll needed to enable this reference is messed up. Instead of having only "%systemroot%system32winhttp.dll", it appends this path to whatever the excel file's current location is e.g. When the file is on my desktop, the path to the dll file is "c:usersdesktop%systemroot%system32winhttp.dll" which rightly returns an "Error in loading DLL" message.

I am not a VB programmer but use the said worksheet regularly for my tasks. I would like to know if there's a workaround/fix for this issue.

Comments

  • I am having the same problem. Have you had any luck in solving it yet?

    I have been searching the net for answers and it seems the winhttp is a problem area. The strange thing is that the service seems to be running on my machine but I can't get reference it in a VBA module and so the code doesn't run.

    On possible workaround may be to start with a workbook with a module in which it is already referenced and replace the content with your own. I've tried that and the code seemed to run, though I didn't succeed in what I was trying to do - update my MySql database from Excel via a web server.

    The "template" I used was:-

    http://www.automateexcel.com/index.php/2005/02/22/excel_vba_to_php_to_mysql_write_from_exc


    : I have an excel file with VB macros that requires the "winhttp"
    : service in order to publish certain results. The file was created
    : using Excel 97. The first time you run it on a system, you obtain
    : compile errors which are easily resolved by enabling the "Microsoft
    : WinHTTP Services, vesion 5.1" reference in the VB debugger. The
    : program works without issues once this is done.
    :
    : The program runs on WinXP SP2 running Office 2003 and Office 2007
    : after the winHTTP service has been enabled. However, on a Vista
    : machine running Office 2007, the path to the winhttp.dll needed to
    : enable this reference is messed up. Instead of having only
    : "%systemroot%system32winhttp.dll", it appends this path to
    : whatever the excel file's current location is e.g. When the file is
    : on my desktop, the path to the dll file is
    : "c:usersdesktop%systemroot%system32winhttp.dll"
    : which rightly returns an "Error in loading DLL" message.
    :
    : I am not a VB programmer but use the said worksheet regularly for my
    : tasks. I would like to know if there's a workaround/fix for this
    : issue.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion