"Error in loading DLL" on Vista

61 views
Skip to first unread message

principal

unread,
Dec 26, 2007, 3:01:37 PM12/26/07
to Windows Vista Tech
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
%\system32\winhttp.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:\users\<username>\desktop\%systemroot%
\system32 \winhttp.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.

Mark

unread,
Dec 26, 2007, 7:33:39 PM12/26/07
to Windows Vista Tech
Hey, a simple thing to do would be to copy the DLL to the local path
of the Excel file. Just curious where you are putting this path in?

Mark

principal

unread,
Dec 26, 2007, 8:51:21 PM12/26/07
to Windows Vista Tech
Having the DLL in the same location as the excel file doesn't do any
good. "C:\windows\system32\winhttp.dll" is ALWAYS appended to the
current path so even if I am opening the excel file from C:\windows
\system32, the path becomes "C:\windows\system32\C:\windows
\system32\winhttp.dll" which clearly makes no sense. The winhttp
object is registered with the OS so it grabs the path to this dll from
an environment variable set somewhere in the registry.

Mark Scammacca

unread,
Dec 26, 2007, 9:54:52 PM12/26/07
to windows-v...@googlegroups.com
Got any code I can look at?

principal

unread,
Dec 27, 2007, 2:07:42 PM12/27/07
to Windows Vista Tech
I was finally able to resolve the issue.

For some unknown reason, Vista can sometimes not have the "winhttp"
service (and a few other services) properly registered. This failure
to register winhttp manifests itself as this issue. To resolve it, we
have to manually register winhttp.

1) Open Vista's menu and type "run" into the search field to bring up
the Run dialog box.
2) In the run dialog box, type in the following - regsvr32.exe "c:
\windows\system32\winhttp.dll"
3) Click Ok.
4) If everything goes well, you should get an acknowledgment saying
"DllRegisterServer in c:\windows\system32\winhttp.dll"
5) Open up the excel worksheet and enable winhttp. Notice that path to
"winhttp.dll" is now correct.
6) In the event that you get an error message after step 3) above, you
will need to disable User Account Control (UAC) for windows. and
repeat steps 1 through 3 after rebooting.
Reply all
Reply to author
Forward
0 new messages