Export many tags value to excel.

Jose Ramos

Member
Join Date
May 2016
Location
Reynosa
Posts
2
I have a trouble with FactoryTalk View Studio because I need export 500 values, I thought in use a for statment and a array because when I try put all the declaration show me a message that say "procedure too large", below you can see the script:

Dim WithEvents MyTagGroup As TagGroup
Private Sub Button7_Released()

Dim MyExcel As Excel.Application
Dim MySheet As Excel.Worksheet
Dim x as integer
Dim mytagvalue as variant
x=2

Set MyExcel = CreateObject("Excel.Application")
MyExcel.Visible = True
'Abrir un Archivo existente
MyExcel.Workbooks.Open "C:\Users\Documents\Cycle TimeCycle_Time.xls"
Set MySheet = MyExcel.ActiveSheet

Dim Tag1 As Tag

For i = 0 to 500
Set MyTagGroup = Application.CreateTagGroup(Me.AreaName)
MyTagGroup.Add "[PLC_10]PalletTime"
MyTagGroup.Active = True
Set Tag1 = MyTagGroup.Item("[PLC_10]PalletTime")
mytagvalue=Tag1.Value
MySheet.Cells(x, 2) = mytagvalue.value
x=x + 1
Next i

'Guardar Ejecucion en un archivo diferente
MyExcel.ActiveWorkbook.SaveAs "C:\Users\demak\Documents\Cycle Time\Cycle_Time" & "-" & Format(Now, "dd-mmm-yyyy-hh-mm-ss") & ".xls"
MyExcel.ActiveWorkbook.Close
MyExcel.Quit

End Sub


Really I need support because I'm new in factorytalk VBA.
 

Similar Topics

Trying to export a Modern application for an upgrade to Intouch 2020 but I cannot export the application from the 2014 version because the export...
Replies
2
Views
67
Hello, Does anyone know how to export the EDD files for a device in DeltaV Explorer 12.3? I can export the .fhx, but I have no idea how to get...
Replies
8
Views
115
Hi, I'm trying to export data from a DataGrid to Excel using VBA, but I'm getting an error "Object doesn't support this property or method". The...
Replies
0
Views
71
Hello to all, Is it possible to export Codesys symbols to .txt, .csv or .xml in a similar manner like exporting symbol table in STEP 7? For...
Replies
0
Views
124
Good morning, I have a Emerson/GE PLC with Cimplicity SCADA. I need to export data of a specific point/object to a CSV file and load the CSV file...
Replies
7
Views
272
Back
Top Bottom