Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Winsock control in VBA Excel !

Status
Not open for further replies.

FaneDuru

Technical User
Jul 15, 2002
141
RO
I have Visual Studio installed on may computer so I'm able to use Winsock control on a form in VBA Excel.
For making the file work on computers which does not have Visual Basic installed I bynari memorized MSWINSOCK.OCX on a sheet of Excel and I am able to rebuild the file in the System folder. I can register the OCX too but VBA does not reconize it.
What else do I hve to do?

Thanks in advance,
Fane Duru'
 
Try setting a reference to it in the Tools-References of the VBA IDE
You may or may not have to browse for it.

Let me know if this works for you.
 
The IDE reference exists in the project containing Winsock. This reference is automating made when I put the control on the form. In case of a computer without VB installed this reference appears like missing... I played on my computer cutting and adding the OCX and the reference was reconized immediatelly after finding the OCX. I try in runtime to put OCX in System directory (like it is in may computer having installed VB 6) of the computer not having VB installd hopping that this reference will become valid....
I don't think that will work but anyhow I will try...
I can do that in run time.
Thanks anyhow,
Fane Duru'
 
Are you aware of some M$ licensing issue doing that ?
 
No !
It was just a chalange for me to see if I can do that without runtime (necessary for VB)...

I setted a reference to the OCX wich I put in the system directory. The reference is OK I can see the control on the form but if I doble click on it I don't go in its code (Winsock1 like it was named ...).

Any suggestion?
Fane Duru'
 
I almost solved the problem. When I've put the Winsock control on the form Excel created a reference to "MSWinsockLib.TWD" with the name "Microsoft Winsock Control 6.0". I memorised also this file and I remade the reference in the virgin VB computer. It didn't work initially. I had to delete the old Winsock control to tick the new one on the additional controls list and put it on the form.
After that everything worked.
I have very seldom such a "virgin" computer available to play with it but now it's easy to fix.
If somebody is interested in seeing the code I can make it available

Fane Duru'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top