Dear Bansodevb,
I need help in SE VBA Code. I got Code for PLC Forum that is working fine.Right Now I want Cells increment Code in vba. Please Help for me. I Have More than 250 Tag.
How to write for above Logic for BMS Application.
I attached that code below
Private Sub Button1_Released()
Dim ObjExcelApp As Object
Dim Fname As String
Set MyTagGroup = Application.CreateTagGroup(Me.AreaName)
MyTagGroup.Add "AI\I1"
MyTagGroup.Add "AI\I2"
MyTagGroup.Add "AI\I5"
Dim SourceErrFile, DestErrFile
Dim Tag1 As Tag
Dim Tag2 As Tag
Dim Tag3 As Tag
Dim Mytime
'Set the tag objects
Set Tag1 = MyTagGroup.Item("AI\I1")
Set Tag2 = MyTagGroup.Item("AI\I2")
Set Tag3 = MyTagGroup.Item("AI\I5")
Fname = "D:\Lord Shiva.xlsx" 'name of already created excel project
Set ObjExcelApp = CreateObject("Excel.Application")
ObjExcelApp.Visible = False
ObjExcelApp.Workbooks.Open (Fname)
ObjExcelApp.WorkSheets("Sheet1").cells(1, "A").Value = Tag1.Value
ObjExcelApp.WorkSheets("Sheet1").cells(1, "B").Value = Tag2.Value
ObjExcelApp.WorkSheets("Sheet1").cells(1, "C").Value = Tag3.Value
ObjExcelApp.ActiveWorkbook.SaveAs Filename:="D:\Lord Shiva" .xlsx"
ObjExcelApp.Workbooks.close
ObjExcelApp.Quit
Set ObjExcelApp = Nothing
Exit Sub
End Sub
Sir Im waiting for your reply
my mail id:
[email protected]
Please send relevant cod my mail sir