none
Is VB6 SP6 required to use MSWinsck.,ocx? RRS feed

  • Question

  • I have Excel 2016 on Win8.1. I'm trying to use MSWinsck.ocx but cannot add it to a VBA Form. I get "Subject not trusted for specified operation" error. I've checked the Killbits and cleared it for MSWinsck. I have the old VB6 SP6 but have not installed it because it wants to install an old version of Visual Studio and I already have Visual Studio 19 on the PC. Internet searches usually turn up nothing but VERY OLD posts concerning the "Not Trusted" error and are also very vague as to the cause. So, must a licensed version of VB6 be installed to eliminate this error?
    Tuesday, November 26, 2019 12:59 AM

Answers

  • Hmm, indeed a bunch of dead links, sorry about that, MS don't want to make it easy but pretty sure they still have the extended runtime files for download somewhere...? 

    Normally can extract files from the download exe or msi, try 7-Zip

    v6.00.8988 looks like an old version, is 10/13/14 the created or modified date? Look in properties.

    AFAIK the newest x32 version MSWINSCK.OCX is 6.1.98.17 dd 2010-02-16 (to avoid us/int date ambiguity), at least that's what mine is which I installed in one system not so long ago.

    • Marked as answer by StupinIs Sunday, December 1, 2019 10:44 PM
    Sunday, December 1, 2019 5:19 PM
    Moderator

All replies

  • Having VB6 installed will do nothing to solve this problem. Instead ensure you've got the updated version of the ocx installed, particularly if your's is an original version shipped with SP6, start here:

    https://support.microsoft.com/en-us/help/932349/ms08-070-vulnerabilities-in-visual-basic-6-0-runtime-extended-files-ac

    Saturday, November 30, 2019 6:45 PM
    Moderator
  • Thanks for reply.

    Yeah, I didn't think having VB6 installed would do any good. The links following the one you provided were either dead or ended up being a dead end. I've searched Microsoft before for MSWINSCK.OCX but they've pretty much abandoned it. The one I have loaded in SYSWOW64 is dated 3/8/2004. I downloaded one online and tried it but it made no difference and I couldn't identify it's date so I kept the Microsoft one. Unfortunately, there is also a dll over in System32 so that could be the problem. Too bad that Microsoft has put so many security hurdles into their software that it's almost not worth the effort to get anything to run. Too bad they don't put as much effort into providing error messages that can be tracked down to something.

    I then tried the Ostrosoft wrapper version of Winsock but it may be very old. At least I could put it on the form. Very strange symptoms, wireShark shows it trying to send message but the RFC 6455 header is blank(all 00's) when it should be populated yet the text is shown.

    Thanks again.


    • Edited by StupinIs Saturday, November 30, 2019 7:36 PM
    Saturday, November 30, 2019 7:27 PM
  • Yes you definitely need newer than 2004, not only for the mswinsck. Try searching for alternate download sources, eg

    https://sourceforge.net/projects/vb6extendedruntime/

    You can probably extract the ones you need from the cab (if that's what it is), you'll probably have to install what you need manually in SysWOW64, start the CMD as administrator

    Just noticed you mentioned one installed in System32, I've also got one, I assume it's an x64 version, if it is it wouldn't work with Office 64, but it shouldn't interfere with anything running x32.

    Saturday, November 30, 2019 8:21 PM
    Moderator
  • Peter,

    Unfortunately, the VB6 SP6 download was an executable rather than cabs. So, I went ahead and installed it and it did do updates and registrations of components. According to the tool I have(acm) it's a newer version dated 10/13/14 v 6.00.8988 which is an improvement. But, I still can't place it on a form(same error- Not Trusted). Again, I made sure the kill bit was cleared in the registry. I'm currently running Office 365 subscription and I don't think I have any visibility into what KB's are installed. I know there were some updates that supposedly caused this problem. I'll have to take a look.

    Thanks

    Sunday, December 1, 2019 1:24 AM
  • Hmm, indeed a bunch of dead links, sorry about that, MS don't want to make it easy but pretty sure they still have the extended runtime files for download somewhere...? 

    Normally can extract files from the download exe or msi, try 7-Zip

    v6.00.8988 looks like an old version, is 10/13/14 the created or modified date? Look in properties.

    AFAIK the newest x32 version MSWINSCK.OCX is 6.1.98.17 dd 2010-02-16 (to avoid us/int date ambiguity), at least that's what mine is which I installed in one system not so long ago.

    • Marked as answer by StupinIs Sunday, December 1, 2019 10:44 PM
    Sunday, December 1, 2019 5:19 PM
    Moderator
  • Man, what an ordeal! Could not find mswinsck.ocx of any recent revision on OCX download sites. So, I grabbed the VS6 SP6 Runtime download and used WinRAR to extract version 6.1.97.82 and it places on the form ok after I cleared the Killbits in the registry. Now I can go back to troubleshooting my original problem of finding out why the server disconnects after I upgrade to TCP and try to send a message(that was with that old Ostrosoft package and still does it after the switch to MSWINSCK version 6.1.97.82). :-)

    BTW, through my reading I found that version 6.1.97.82 is the last stable version. Apparently, version 6.1.98.16 would break when acting as a server in listen mode. Not sure about 6.1.98.17. I also heard there is a version 6.1.98.18 but who knows? Microsoft washes their hands of all of it. :-)

    Thanks for all your help. I never would have tracked it down without your clues!

    Sunday, December 1, 2019 10:59 PM
  • This is a later list of the extended runtime files and version specs:

    https://support.microsoft.com/en-gb/help/957924/description-of-the-cumulative-update-rollup-for-the-visual-basic-6-0-s

    The download link is broken, but found this in my my bookmarks and is working as of today. FWIW it refers back to the KB957924 (above), but not the other way round.

    https://www.microsoft.com/en-us/download/details.aspx?id=7030

    You can extract the Mswinsck.ocx 6.1.98.17 from the msi if you don't want to install the lot. Why not do that and see if you can restore the Killbits, and if that works is it also 'stable' in terms of what you described about 6.1.98.16. Oh and let us know!


    Monday, December 2, 2019 9:54 AM
    Moderator
  • Ok, let me try to explain my current situation. I said that I installed and registered the MSWINSCK.OCX version 6.1.97.82 and it behaved the same as the old Ostrosoft wrapped Winsock. So, I wanted to delete that old stuff and I got rid of oswsock.dll in SysWow64 and immediately everything stopped working. Evidently, it had been using the library from that old installation. I can't even get VBA to compile. My current configuration is:

    C:\Windows\SysWow64\MSWINSCK.OCX version 6.1.97.82 6/30/2014

    C:\Windows\SysWow64\mswsock.dll version 6.3.9600.18340 5/13/2016

    C:\Windows\System32\mswsock.dll version 6.3.9600.18340 5/13/2016

    I don't know how or why the dll is over in the System32 directory. I thought that was reserved for only 64-bit libraries. Another thing I'm unsure about is how an OCX is mapped to a DLL file. Seems like the two must go together as a package.

    I was able to download the VB6SP6 update so I'll take a look at that and if I can find two matching OCX/DLL files I'll replace what I have in SysWow64 and hope that solves the problem.

    Thanks

    Monday, December 2, 2019 11:11 PM
  • I was able to extract the mswinsck.ocx from the msi. Surprisingly, there was no mswsock.dll. I've checked against another Win 8.1/Ofc2016 PC and the file versions for mswsock.dll are identical so I guess these should be ok.

    Then I unregistered C:\Windows\SysWow64\mswinsck.ocx version 6.1.97.82, registered version 6.1.98.17, and made sure the Killbits were reset. Then I searched for the OCX and made it a reference. Now, no Winsock ActiveX control appears in the Toolbox nor is it there to add to the toolbox. I wonder if I have some sort of cache file in Appdata that needs to be erased?

    Tuesday, December 3, 2019 2:10 AM
  • Does it appear in tools/references. If not try browsing to it and see if it then appears in the list of additional controls in the toolbox. Maybe before doing that delete the toolbox file which if corrupted with missing entries can cause the toolbox to appear over Excel when you don't want it, excel.box in appdata-ms-forms.

    Can you do this:

    Dim oWS As Object
    Set oWS = CreateObject("MSWinSock.WinSock")

    FWIW as I suggested in a related forum about 15 years ago!


    Tuesday, December 3, 2019 1:49 PM
    Moderator
  • Peter,

    There is no sign of Excel.box anywhere in AppData. Microsoft Winsock Control 6.0 (SP3) and
    Microsoft Rich Textbox Control 6.0 (SP3) both are checked off in References. Rich Textbox is greyed out and Winsock is nowhere to be found in the Toolbox. It appears there is no relationship between References and what controls are available(or work) in the Toolbox.

    Curiously, in the Object Browser, MSWinsockLib appears with Winsock as a global with all the constants and methods defined. Yet it doesn't appear as a Toolbox component?

    I also did a repair of Office but no help. I didn't try the code because I need to get the
    object on the form first.

    Thanks

    Tuesday, December 3, 2019 5:40 PM
  • If you're not using Excel search your app-name.box or *.box, you should fond it in one of the appdata type folders. With the app closed delete the .box file, next time it will be recreated with a default toolbox, no additional controls. 

    If you can see the Winsock library in Object Browser you file you've obviously got a reference to Winsock in your file. Just that wouldn't establish if you can actually create an instance. This is really the first thing to check before moving on, and with the ref you should be able to do:

    Dim wsk as Winsock
    Set wsk = New Winsok

    ..essentially the same as what I suggested earlier except early binding. Checking this should only take a few seconds.

    After recreating the .Box file, and with a reference in tools/ref's, on the toolbox see if you can  find Microsoft Winsock in Additional Controls

    Tuesday, December 3, 2019 6:56 PM
    Moderator
  • 1. Deleted Excel.box in AppData/Roaming(only one found)
    2. Opened new Book1 just in case there was something damaged in my original workbook
    3. Used browser to find MSWinsck.ocx & RichTextBox.ocx and added to References
    4. Checked Object Browser. It lists:
        MSWINSOCKLIB
        RichTextLIB
        Search for Rich found Library & Classes. Search for WIN - found Library & Classes
    5. Added Userform & opened Toolbox additional controls. Neither Winsock or RichTextBox appear
    6. Still, attempted to add code
        Dim wsk As Winsock
        Private Sub UserForm_Click()
        Set wsk = New Winsock
        End Sub
    There were no errors generated and Blank Form displayed.

    Now I'm not sure what to think. So, I went back to my original workbook and tried it. Added winsock ref and same result with Toolbox(no Winsock available). Changed code slightly to read-

    Dim WithEvents ws80 As Winsock
    Dim WithEvents ws81 As Winsock
    In procedure:
    Set ws80 = New Winsock
    Set ws81 = New Winsock

    Got-

    Error 429 - ActiveX component can't create object  
    followed by component or data member not found.

    Seems like I've got to be able to put the control on the form before I can access it.
    Tuesday, December 3, 2019 11:15 PM
  • Seems odd, if I follow 'Set wsk = New Winsock' works in your new wb but similar fails in your old wb. Is that in the same system and with the winsock ref in the old wb updated to the new winsock file . . ?

    Sometimes available and potentially valid references don't appear in tools/refs (but can browse to), or in the additional controls list.

    In the new wb can you add the control with code at runtime, eg in in a click event

    Private Sub UserForm_Click()
    Dim wCtl As Winsock
    Set wCtl = Me.Controls.Add("MSWinsock.WinSock.1")
    With wCtl
    Stop ' see wCtl in Locals
    End With
    End Sub

    If that works assign a WithEvents reference to it. 

    Hmm, I saved an xlsm with a Winsock control on a userform, reopened and got a message "This application is about to initialize ActiveX controls that might be unsafe. If you trust the source of this file select OK... ", then all worked fine. This was with 6.1.98.16.

    FWIW I know the RTB has long been marked unsafe, not sure if a safe version exists(?)

    Edit, forgot to mention can also add controls with code as 'Designer' which will persist if adding at runtime works but not a good solution ofr other reasons.
    Wednesday, December 4, 2019 10:55 AM
    Moderator
  • Peter,

    First some background:

    I've been trying to get Office 365 subscription off of my systems for a number reasons such as annual cost, lack of support and forced updates. The forced updates is the main reason. With Windows 8.1 I get notification that updates are available but I can review them before they are installed so I can at least
    anticipate problems and decide whether to install them or not. With Office 365, updates are Yes or No and
    occur frequently(I've caught Click-To-Run downloading often using Resource Monitor). So, I've tried to replace Office 365 with Office 2016 Pro Plus on my two PCs. It appears that Office 365 makes it's installation irreversible. Maybe by some registry settings or file changes,I have no way to know, but I think a lot of the issues I've faced may be due to that. At any rate, I've restored Office 365 to this PC and now I can add the MSWinsck.ocx to the form so that solves that problem.

    Now down another rabbit hole:

    My original VBA code using the old version of mswinsck.ocx worked(to the point of not being able to upgrade HTTP to TCP) but now it fails.
    When it gets to the websocket.connect it fails because websock reports it's status as being 1(connected)
    which is not possible, but, I added code to force it closed and a delay then connect but it just hangs with no events. When I look at the Object Browser the websocket(this is now upgraded to mswinsck.ocx v 6.1.98.17) is defined as part of an  "F3Dynamic Library". A quick search turns up that such a library is a Visual Basic Access library and people use words like hidden and mysterious. :-) My guess is that it is really referring to the 32-bit mswsock.dll library in SySWoW64 :-)
    So now, unless there is some special method required for this to work and generate events in VBA
    then it's another dead end and maybe I'll go search for a slightly earlier "library" version that's not "F3Dynamic".
    I hope I can even do that. The last time I tried I ran into problems because it was owned by the
    Trusted Installer and even when I changed ownership to Administrators I still couldn't use regsys32
    to de-register it and register a new one. My last alternative is to use Visual Studio to develop a Task Pane for Excel but that's also dead in the water because of a Javascript "Security Error" in the connection request.

    Fun and Games in Microsoft City. :-)
    Martin
    Thursday, December 5, 2019 12:07 AM
  • 365 is SaaS and so automatic updates to be expected. That said I when start a 365 app I get a banner .. updates are avaiable  - update now.. which I can dismiss if not convenient.

    It should be possible to fully uninstall 365, see here

    I don't think I can add anything more about Winsock relevant you've just added, but good luck and if/when you fix things post back with anything relevant. There might be a better forum for specific Winsock issues.

    Friday, December 6, 2019 2:48 PM
    Moderator
  • Thank you so much for your reply. I didn't think updates to O365 were option-able.

    Just an update and I won't bug you again. The Excel spreadsheet I'm using is a test bed for the Winsock and it's heavily instrumented to watch winsock connection activity. It tells me that everything goes ok until I try to connect. At that point, it does not get a "handle" from the Win 8.1 OS. It seems that there is a disconnect between Excel and the OS. At least, in this instance.

    Martin

    Sunday, December 8, 2019 11:34 PM