Siemens Protool question

Thim

Member
Join Date
Mar 2008
Location
Belgium
Posts
392
hello,

I came across a example program of Siemens to write and read out/in excel but when i try to write script allways opens a new excel file and asks me to save it.
Can someone tell me how to prevent this?

The file in which the script is pointing does excist in that specific map

Probably it is in this part of the script

'Excel speichern und beenden
//XL_BW.ActiveWorkbook.Close(true)

Is there someone who knows how i can just write to it without allways have to "save as" it?

this is the script


'Variable, der Excel-Tabelle zugewiesen wird (Excel-Beispielwerte)
Dim XL_BW
'Zuweisung Excel-Applikation
Set XL_BW = CreateObject("excel.application")
'vorhandene Tabelle öffnen
XL_BW.workbooks.open "C:\Werkmap\Recepten PC\Voorbeeld plc programma\bsp_rezeptur.xls"
'Tabellen-Einträge (Zeile, Spalte)
XL_BW.cells(row,1).value = Now
XL_BW.cells(
row,2).value = VAR1_INT
XL_BW.cells(row,3).value = VAR2_REAL
XL_BW.cells(
row,4).value = VAR3_STRING
'Erhöht den Zeilenindex, um beim nächsten Aufruf in die Folgezeile zu schreiben
row = row + 1
'Tabelle nicht anzeigen
XL_BW.visible = false
'Excel speichern und beenden
XL_BW.ActiveWorkbook.Close(true)
'Verwendeten Speicher wieder freigeben
'Used storage will be freed
Set XL_BW = Nothing



Thx


 
I suggest dump excel and write to csv in stead. It is easy, you can find examples, also on this forum.
You can very easily write one or more lines to an existing csv file (appending).
And csv files can be opened easily with excel for example.
And you dont have to have Excel installed on the PC.
I dont understand what advantage there is with writing directly to Excel.
 
I suggest dump excel and write to csv in stead. It is easy, you can find examples, also on this forum.
You can very easily write one or more lines to an existing csv file (appending).
And csv files can be opened easily with excel for example.
And you dont have to have Excel installed on the PC.
I dont understand what advantage there is with writing directly to Excel.

Don't see any advantage either but this was a example that i founded on the Siemens site. (I don't know anything from scripting so i just copied it to have a look)
I'm not sure but i think i can easy change the file name to *.csv and that the script wil still work. Have to test it.
But do you know if it would be possible to have the *.csv file open and write to it at the same time?

Thx
 
Nice the *.csv is working acctualy the *.xls is also working
I only had to configure the file as shared.
Do you know if it would be possible to have a bit/word back when the communication has been finished? Or do you know some good manual about it ?

Thx
 

Similar Topics

Hello, I am trying to break in into project from 2012 because it may require some modifications. Currently I am in stage of trying to understand...
Replies
6
Views
2,395
I am trying to convert a Protool backup to WinCC 2008 SP2. I can start the migration wizard and the PDB file passes the consistency checks. But...
Replies
5
Views
2,135
Hello I have a project for which I need to convert Protool to WinCC for an upgrade. I have WinnCC Flex SP2 but its the Standard version and I...
Replies
7
Views
3,630
Does anyone have the old ProTool software from Siemens? I was wondering if someone could open a project for me or sell me the software. From...
Replies
12
Views
7,921
Does anyone have the old ProTool software from Siemens? I was wondering if someone could open a project for me or sell me the software. From...
Replies
0
Views
2,850
Back
Top Bottom