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

Hi, I need help adding a new interlock switch to an existing circuit. I have never done on the existing circuit. I did set it up on the...
Replies
5
Views
152
Hi all I’m looking at adding a RFID card reader to comfort panel pro , how do you set the rfid up can you connect to existing users and password...
Replies
0
Views
65
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
125
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
104
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
177
Back
Top Bottom