Visual Basic Script to excell

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
Post Reply
mike347
Posts: 1
Joined: Fri Jul 18, 2014 5:55 pm

Visual Basic Script to excell

Post by mike347 » Tue Feb 23, 2021 2:15 am

Tia Portal v15.1

How can I put the date and time in an Excel file with a Visual Basic script?
Can you help me??

Greetings

Rex2701
Posts: 370
Joined: Wed Oct 13, 2010 8:44 am
Location: Russian Federation

Re: Visual Basic Script to excell

Post by Rex2701 » Tue Feb 23, 2021 2:00 pm

stackoverflow.com helps you:

Code: Select all

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("Your_Excel_File.xls")
objExcel.cells(1,1).value = "Test value"
objWorkbook.Save
objWorkbook.Close
But it is a pure VBS example. I have no idea does TIA supports the "CreateObject" directive or not.

Post Reply