ymcorp
Jan 9th, 2008, 01:09 PM
well let me start off and explain what i am doing. for anyone that is familiar with "XL Reporter" you may be of some help. ok i have a button that when it is clicked it goes through this process of running a schedule and connecting through rslinx. so on my spreadsheet where the button is located i have used a data management function to send a number that i have in a cell. so when the button is pressed, it really runs the data management function and exports my desired cell (containing a number) to rslinx which is recieved by the plc. here is the button code if u are curious.
Private Declare Function XLRrequest Lib "XLRexcel" (ByVal s As String) As Integer
eet '" + GetBookSheet + "'"Private Sub pbWriteToTag_Click()
Dim s As String
s = "UpdateSh"
XLRrequest s
End Sub
Private Function GetBookSheet() As String
Dim i As Integer
' Get the current wb name
GetBookSheet = ActiveWorkbook.Name
' strip off xls at the end
i = InStr(1, GetBookSheet, ".xls")
GetBookSheet = Left(GetBookSheet, i)
' Add the current ws name
GetBookSheet = GetBookSheet + ActiveSheet.Name
End Function
ok so hopefully you get what is going on there. now this is a very combersum approach to what really needs to do and is not very user friendly. i am just learning vb so i do not know to much about it.
Now what i really want to do is to have a button in my vb program so that when a user clicks it, it will lets say turn on a light. so what needs to happen is when that button is clicked it ultimately will connect to rslinx and be able to write a number to the plc. i have rslinx installed (yes the non lite vs.) so i am wondering if there is a way to do this w/o having to go through another program of some sort
Private Declare Function XLRrequest Lib "XLRexcel" (ByVal s As String) As Integer
eet '" + GetBookSheet + "'"Private Sub pbWriteToTag_Click()
Dim s As String
s = "UpdateSh"
XLRrequest s
End Sub
Private Function GetBookSheet() As String
Dim i As Integer
' Get the current wb name
GetBookSheet = ActiveWorkbook.Name
' strip off xls at the end
i = InStr(1, GetBookSheet, ".xls")
GetBookSheet = Left(GetBookSheet, i)
' Add the current ws name
GetBookSheet = GetBookSheet + ActiveSheet.Name
End Function
ok so hopefully you get what is going on there. now this is a very combersum approach to what really needs to do and is not very user friendly. i am just learning vb so i do not know to much about it.
Now what i really want to do is to have a button in my vb program so that when a user clicks it, it will lets say turn on a light. so what needs to happen is when that button is clicked it ultimately will connect to rslinx and be able to write a number to the plc. i have rslinx installed (yes the non lite vs.) so i am wondering if there is a way to do this w/o having to go through another program of some sort