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 = fspenTextFile(tagFilename,1)
strLine =objFile.ReadAll
objFile_1.Write strLine
objFile_1.Close
objFile.Close
-----------------------------------------------------
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 = fspenTextFile(tagFilename,1)
strLine =objFile.ReadAll
objFile_1.Write strLine
objFile_1.Close
objFile.Close
-----------------------------------------------------
Last edited: