5/20/2020 12:23 PM | |
Joined: 5/15/2020 Last visit: 2/20/2023 Posts: 3 Rating: (0) |
hello can i get some help here. I want to write data in the row but i want to keep the old ones .So every time data is stored in the next row.I m doing it with vb script i have tia portal and win cc V15.0 and using excell 2010.I want that the data is transfer in the next row everytime there is one butonn pressed. I have code which works but i have to fiks my problem with writing data to the next rows . This is my code : Sub vpis_v_excell() Dim objXLApp , objXLWb , objXLWs1 , objXLWs2 ', x Set objXLApp = CreateObject("Excel.Application") objXLApp.Visible = False Set objXLWb = objXLApp.Workbooks.Open ("C:\report\Book2.xlsx") Set objXLWs1 = objXLWb.Sheets(1) Set objXLWs2 = objXLWb.Sheets(2) 'If SmartTags("Start Leader bit") = 1 Then ' x = x+1; 'End If With objXLWs1 .Cells(1,1).value = date .Cells(1,2).value = SmartTags("sr751_STRING") End With objXLWb.Save objXLWb.Close objXLApp.Quit Set objXLWb = Nothing Set objXLWs1 = Nothing Set objXLWs2 = Nothing End Sub If someone can help me with my problem and try to writte the mising code i would really apriciate it. Regard Aljaz ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 05/20/2020 13:20:53New subject after splitting |
|
Follow us on