ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compiling error! VBA Help needed (https://www.excelbanter.com/excel-programming/325510-compiling-error-vba-help-needed.html)

Mary

Compiling error! VBA Help needed
 
Hi Everyone,

I am having a problem integrating an Active X component in my work sheet,
where the first time I run the worksheet, it will have a compiling error
pointing at the ActiveX Component, but if I close the worksheet and then
reopen again, it runs fine. Does anyone know how I can get rid of this
problem?
The error message is:
Compile Error: Method or data member not found.
and it is pointing at this line:
Set sckMail = frmSck.Winsck
Any help would be much appreciated!

Thanks heaps!
= )
Cheers,
Mary

OJ[_2_]

Compiling error! VBA Help needed
 
Hi Mary,
Please tell us what version and OS and also post the code you are
using...are you using Late or early binding?..

Cheers,
OJ


Mary

Compiling error! VBA Help needed
 
Hi OJ,
I am currently using Windows 2000 and Office 2000, actually I am no expert
in coding, so I am not too sure if this classifies as a late or early
binding...
but I could send you the excel worksheet if you don't mind...

I have a private fuction which declares it...
Private WithEvents sckMail As WinSock ' project must include
the Winsock control
' or a reference to the
mswinsck.ocx

Thanks heaps!
Cheers,
Mary

"OJ" wrote:

Hi Mary,
Please tell us what version and OS and also post the code you are
using...are you using Late or early binding?..

Cheers,
OJ



OJ[_2_]

Compiling error! VBA Help needed
 
Hi Mary,
Feel free to mail the sheet but try this first...

Uncheck the reference to winsock and run this sub...do you get an
error?

Sub Createthis()
Dim objWinSock as Object

Set objWinSock = CreateObject("WinSock")

End SUb

FYI, early binding is creating a reference to an object in the
ToolsReferences dialog and the above code is an example of Late
Binding...

Hth,
OJ



All times are GMT +1. The time now is 04:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com