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:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* 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
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read

Microsoft Office support MS Office support forum

Reply
 
Thread Tools
Old 07-16-2008, 03:21 PM   #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!
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-16-2008, 04:05 PM   #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"
David M58 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-16-2008, 07:47 PM   #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.
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-16-2008, 08:57 PM   #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.
David M58 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-17-2008, 07:42 AM   #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.
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-17-2008, 03:05 PM   #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.
David M58 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-18-2008, 01:43 PM   #7 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 21,381
OS: Win XP Pro SP3

My System

Blog Entries: 10
Send a message via MSN to Glaswegian
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
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-19-2008, 09:10 AM   #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!
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-19-2008, 09:12 AM   #9 (permalink)
Registered User
 
Join Date: Jul 2008
Posts: 8
OS: Vista SP1


Re: Broken VBAProject Reference

One other thing, regsvr32 /u winhttp.dll gets the same 0x80070005 error.
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-19-2008, 02:22 PM   #10 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 21,381
OS: Win XP Pro SP3

My System

Blog Entries: 10
Send a message via MSN to Glaswegian
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
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-19-2008, 06:12 PM   #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
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-19-2008, 06:29 PM   #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.
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-20-2008, 01:36 PM   #13 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 21,381
OS: Win XP Pro SP3

My System

Blog Entries: 10
Send a message via MSN to Glaswegian
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
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-22-2008, 08:32 AM   #14 (permalink)
Registered User
 
Join Date: Jul 2008
Posts: 8
OS: Vista SP1


Grin Re: Broken VBAProject Reference

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
joethall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Old 07-22-2008, 12:39 PM   #15 (permalink)
Moderator/ Rangemaster TSF Academy; Analyst, Security Team; Oor Wullie; TSF Surgeon and Resident Comic
 
Glaswegian's Avatar
 
Join Date: Sep 2005
Location: Glasgow
Posts: 21,381
OS: Win XP Pro SP3

My System

Blog Entries: 10
Send a message via MSN to Glaswegian
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
Glaswegian is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Bookmark on Thread SoupReddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -7. The time now is 06:07 AM.



Copyright 2001 - 2008, Tech Support Forum

Search Engine Friendly URLs by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45