Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...with companys cutting back on training, lack of true support by makers of software, the forums are a great tool in your cyber-toolbox...."

Geography

Where in the world do Tek-Tips members come from?
piowtrpolo (Programmer)
18 Jul 12 18:03
I'm going to do my best to explain the problem I have the best I can.

I am using excel 2007 and the VBA associated with it. I don't think it is visual basic 6.0 or not, the program just says VBA. I created a form and the code associated with it fine, but I ran into a problem when I'm trying to include a winsock box into the form so it can connect to an outside source. I have installed the proper mswinsk.ocx and tried everything I can think of, but I can't add a winsock box to my form. When I do try to add a winsock box to the form I get the error "The subject is not trusted for the specified action." I think the code will work properly if I can just add the winsock box to the form.

Please help me with any advice you have.
taupirho (Programmer)
19 Jul 12 4:27
See if this similar thread helps at all

http://www.tek-tips.com/viewthread.cfm?qid=1530759


In order to understand recursion, you must first understand recursion.

piowtrpolo (Programmer)
19 Jul 12 13:11
I followed that setup, but now I get a different error saying "The control could not be created because it is not properly licensed." I'm going to continue looking around for a solution to this new problem. If you have another thread with this problem please let me know. Thank you.
strongm (MIS)
19 Jul 12 14:03
The VB6 winsock control is NOT distributable with a design-time license. Hence the message you are getting. These days there is theoretically no legal workaround for this - although if you can find a legit downloadable copy of the free VB5 CCE (control creation edition) and install it on your machine this includes the design-time licence. Note that you would need to install this on any machine that you intend to deploy your application on so that they in turn can use the winsock control (unfortunately VBA is to all intents and purpses always considered to be in design-time mode)
piowtrpolo (Programmer)
19 Jul 12 16:46
I got VB5 CCE and installed it on my machine, but I am still get the same error of no license is found. I tried creating a winsock in VB5 CCE and I get "License information not found."
strongm (MIS)
19 Jul 12 18:46
Which suggests it might not be a legit CCE installation ...
piowtrpolo (Programmer)
19 Jul 12 19:41
Alright I finally got it working by using another computer and then transferring the project to my computer. Now I have a problem with the code I'm trying to receive and sending it to the worksheet in excel. I don't know how to put code in, but here is the code I have so far. Every time I try to upload the data I get an error: 91 object variable doesn't exist.

Private Function putDataInExcel(data As String)
'Called from wsTCPDevice_DataArrival
'parses out data from In-Sight and puts it directly into excel spreadsheet

Dim exlWSheet As Object
Dim exlRow As Integer
Dim exlCol As Integer


On Error GoTo excelError

Dim index As Integer
'Dim dataval As String
Dim delim As String
Dim term As String
term = vbCrLf
delim = txtDelimiter

'reset exlRow
exlRow = 4

'get index of first delimiter
index = InStr(data, delim)
While index <> 0
'pick off data and put into excel
exlWSheet.Cells(exlCol, exlRow) = Left(data, index - 1)
'trim data off string
data = Mid(data, index + 1)
exlRow = exlRow + 1
index = InStr(data, delim)
Wend
'trim off termininator and
'get last piece of data into excel
exlWSheet.Cells(exlCol, exlRow) = Mid(data, index + 1, InStr(data, term) - 1)

exlCol = exlCol + 1
Exit Function

excelError:
'Excel is probably closed
MsgBox "Error: Excel was shut down", , "Error: " & Err.number & " " & Err.description

End Function
strongm (MIS)
20 Jul 12 5:20
>Dim exlWSheet As Object

At no point do you Set this object (to a spreadsheet). Hence the moment your code reaches

exlWSheet.Cells(exlCol, exlRow) = Left(data, index - 1)

it will error.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close