Adding a worksheet to an excel file using vb script in Wincc Flexible (Siemens PC sw)

Smita

Member
Join Date
Jan 2012
Location
Goa
Posts
6
Hi,

I have to convert my csv file to an excel sheet in Wincc Flexible 2008 for which I have written the following code snippet:
'Alarm_Log.csv' is the file I have to read and 'writing_test.xls' is the excel file that i create and then write to.

My problem is that I need to know how to add a work sheet or create a new excel sheet when the present excel sheet is full.
Could somebody kindly suggest?

Thanks!
--------------------------------------------------------------
Dim tagFilename
Dim strFilename, strLine
Dim fso, objFile, objFile_1


strFilename="C:\log\writing_test.xls"
Set fso = CreateObject("Scripting.FileSystemObject")
'filepointer to write file
Set objFile_1 = fso.CreateTextFile(strFilename,True)
tagFilename="C:\log\Alarm_log.csv"



'filepointer to read file
Set objFile = fso_OpenTextFile(tagFilename,1)

strLine =objFile.ReadAll
objFile_1.Write strLine


objFile_1.Close
objFile.Close
-----------------------------------------------------
 
Last edited:

Similar Topics

Hello all! So I have one project with a S7-1214 and a MTP1500 "Project1" and one project with another S7-1214 "Project2". Both of these PLC:s need...
Replies
6
Views
83
Hi Everyone, Currently we have three plants running with Controllogix PLCs (L72, L73, L74). In each of these plants we have 2 FTView SE...
Replies
0
Views
78
Hello, Im building project with 1756-L82ES controller and 1756-IB16S card but i cant find it when trying to add the card to IO configuration...
Replies
3
Views
147
Hello, I have a pair of redundant 1756-L71 controllers rev 24. These controllers currently have produced and consumed tag interfaces to 3 other...
Replies
2
Views
176
I'm adding an IAI Gateway with 2 axes connected to it. To an ethernet network on my PLC. So, I think the math is correct on the Input and Output...
Replies
0
Views
150
Back
Top Bottom