![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Microsoft Office support MS Office support forum |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Broken VBAProject Reference
If I open an brand new Excel 2007 spreadsheet, open Visual Basic, left-click Tools, left-click References, scroll down to Microsoft WinHTTP Services, version 5.1 and select it.
On my system the location given at the bottom of the window is: C:\Users\JoeAdmin\Documents\%SystemRoot%\system32\winhttp.dll If I check the box for this entry and hit OK it will fail with "Error in loading DLL". I can find no way to correct the location to: C:\Windows\system32\winhttp.dll This is where a fresh version of winhttp.dll exists. I have searched hign and low for any material on this issue and have found none. Can anyone tell me how to: - Edit this location - Remove this entry totally so that I can reinstall it from scratch - Anything else that might solve this problem Thanks! |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: May 2008
Location: Baltimore, Maryland
Posts: 97
OS: Windows XP SP3
|
Re: Broken VBAProject Reference
You may be able to update the reference by running this line of code:
Code:
ActiveWorkbook.VBProject.References.AddFromFile "C:\Windows\System32\winhttp.dll" |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Re: Broken VBAProject Reference
Well, that worked to some extent. The entry "Microsoft WinHTTP Services, Version 5.1" is now checked (and that didn't work before) but when it is selected it has the wrong Location.
|
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: May 2008
Location: Baltimore, Maryland
Posts: 97
OS: Windows XP SP3
|
Re: Broken VBAProject Reference
I think that the location displayed in the References dialog may be inaccurate. %SystemRoot% normally refers to C:\Windows, so the entry:
C:\Users\JoeAdmin\Documents\%SystemRoot%\system32\winhttp.dll does not look right to me. There is definitely a glitch somewhere. |
|
|
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Re: Broken VBAProject Reference
Yes, I very much agree that the location of C:\Users\JoeAdmin\Documents\%SystemRoot%\system32\winhttp.dll
is bogus. However, I have not been able to find a way to either modify the location or even to remove the entry all together. In VBA there appears to be the method ActiveWorkbook.VBProject.References.Remove but I have yet to come up with the proper way to reference the WinHTTP reference. |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: May 2008
Location: Baltimore, Maryland
Posts: 97
OS: Windows XP SP3
|
Re: Broken VBAProject Reference
I understand, Joe.
Once the AddFromFile is done, if I run: Debug.Print ActiveWorkbook.VBProject.References("WinHttp").Description it returns: Microsoft WinHTTP Services, version 5.1 If I run: Debug.Print ActiveWorkbook.VBProject.References("WinHttp").FullPath it returns: %SystemRoot%\system32\winhttp.dll If anyone else has some insight into this, that would be great. |
|
|
|
|
|
#7 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: Broken VBAProject Reference
%SystemRoot% is certainly the correct location. Try going to the file in the Documents folder and rename it to winhttp.dll.old - then try in the VB Editor again.
If the version in your system32 folder is not found (although it is physically there) you may need to re-register the file. Go to Start->Run and copy and paste the following into the box, regsvr32 winhttp.dll then click OK. Now reboot your system. Let us know if that works.
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() Ad-Aware::SpywareBlaster::SpyBot::SpywareGuard::SnoopFree::AVG Free::HOSTS File::HijackThis::Donate::5 Steps For Infected PCs |
|
|
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Re: Broken VBAProject Reference
Guys, both of you, thanks! However, things did not work out all that well.
I must not have something configured right because the suggested Debug.Print statements get "Subscript out of range". I'm guessing that this is the References("WinHttp"), but I don't know how to fix it. Can you tell me where to find the object model documentation that shows that, for example, Description is a value of References? I've search all over and can't seem to find anything like that. I did find the file in C:\Users\JoeAdmin\Documents\System32\winhttp.dll and I renamed it to winhttp.dll_old. However, this did not cause any change in any of the behaviors. I ran regsrv32 winhttp.dll and I get "The module "winhttp.dll" was loaded but the call to DllRegisterServer failed with error code 0x80070005". I've search around for this error code and found nothing useful to this particular problem. Finally, the statement ActiveWorkbook.VBProject.References.AddFromFile "C:\Windows\System32\winhttp.dll" causes the checkbox to be set and the entry to show up at the bottom of the list of already checked boxes. HOwever, the Location is still incorrect. I did save the spreadsheet and when it was reopened the entry was still at the bottom of the checked list but with the wrong location. Please keep the thoughts coming as I have the feeling that we are slowly but surely sneaking up on a solution! Thanks! |
|
|
|
|
|
#10 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: Broken VBAProject Reference
Hi Joe
It does appear that this is a problem unique to the combination of Vista and XL2007. I have found others who have reported that Vista/Excel seems to append the correct path to the dll on to the Excel file location. The indications are that this is indeed some kind of invalid registration of the dll file. Let's try re-registering the dll using the full path this time As before, click Start > Run and copy/paste the following into the Run box regsvr32.exe "c:\windows\system32\winhttp.dll" Click OK - if all goes well you should receive a message something like "DllRegisterServer in c:\windows\system32\winhttp.dll" Then try adding the Reference again and see if the path is now correct.
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() Ad-Aware::SpywareBlaster::SpyBot::SpywareGuard::SnoopFree::AVG Free::HOSTS File::HijackThis::Donate::5 Steps For Infected PCs |
|
|
|
|
|
#11 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Re: Broken VBAProject Reference
Trying regsvr32.exe "c:\windows\system32\winhttp.dll" gets me that same 0x80070005 error. "The module c:\windows\system32\winhttp.dll was loaded but the call to DllRegisterServer failed with error code 0x80070005."
I've discovered that ActiveWorkbook.VBProject.References.Item(I).FullPath is shown to be: %SystemRoot%\system32\winhttp.dll and I note that this, at least in and of itself, seems right. Just to be complete and in the hopes it triggers someone, here's the rest of the ActiveWorkbook.VBProject.References.Item information: Description: Microsoft WinHTTP Services, version 5.1 FullPath: %SystemRoot%\system32\winhttp.dll Builtin: False Major: 5 IsBroken: False Guid: {662901FC-6951-4854-9EB2-D9A2570F2B2E} Collection.Count: 6 Collection.Parent.FileName: C:\Users\JoeAdmin\Documents\RestWinHttpReference.xlsm |
|
|
|
|
|
#12 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Re: Broken VBAProject Reference
Just an additional note to indicate that the error message cited above mentions DllUnregisterServer and at least http://msdn.microsoft.com/en-us/libr...57(VS.85).aspx suggests that the base information is somewhere in the registry.
|
|
|
|
|
|
#13 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: Broken VBAProject Reference
Hi Joe
The only thing I could find on this subject (at least that provided any help) was this http://groups.google.com/group/windo...6e2ad8b20c1899 Try following the guidance in the last post, especially the bit about disabling UAC.
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() Ad-Aware::SpywareBlaster::SpyBot::SpywareGuard::SnoopFree::AVG Free::HOSTS File::HijackThis::Donate::5 Steps For Infected PCs |
|
|
|
|
|
#14 (permalink) |
|
Registered User
Join Date: Jul 2008
Posts: 8
OS: Vista SP1
|
Hallelujah![]() Re-installing the WinHttp library, but with UAC turned off, solved the problem! I couldn't be happier!! Thanks to EVERYONE who chipped in with advice and ideas. But special thanks to Glaswegian who hit upon the UAC magic. Thanks joethall |
|
|
|
|
|
#15 (permalink) |
|
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
|
Re: Broken VBAProject Reference
Glad it worked for you.
__________________
Iain - Defender of the Haggis and all things Scottish. I don't help by PM - post in the Forums. ![]() ![]() Ad-Aware::SpywareBlaster::SpyBot::SpywareGuard::SnoopFree::AVG Free::HOSTS File::HijackThis::Donate::5 Steps For Infected PCs |
|
|
|
![]() |
| Thread Tools | |
|
|