7/28/2009 3:20 PM | |
Posts: 99 Rating: (7) |
Mayby you can create a internal 8 bit char tag. for date dim oTag 'character tag for date set oTag = HMIRuntime.Tags("TAG") oTag.Write(CStr(Date)) 'makes a string of the date and write it to tag so tag is date in your code Srtring becomes "D:\ORCHID\BACKUP\REPORTS\AIR CONSUMPTION"& oTag.Read &".XLS" then you have an excelfile with date. for folder the same way for creating a folder see this site http://www.pcreview.co.uk/forums/thread-1469322.php greetings ME |
This contribution was helpful to1 thankful Users |
7/30/2009 6:12 AM | |
Posts: 691 Rating: (37) |
Dear ddg I tried this script but was getting one problem I created one Internal Tag of "Text Tag 8 bit Character Set", and assigned that to 'filename' in the variable in the VB Script. But it was not taking the path which I have given as ("F:\Try.xls") or (F:\try.xls) And when I am assigning the same path inside the script without using the Tag, Its creating the Excel File Where I have given the Path My Intention is to take the Path and Filename from the Screen create it in the Path specified to it I Attaching the Screenshots of the tag, the Screen and the Script AttachmentWinCC Script.zip (1338 Downloads) |
7/30/2009 8:24 AM | |
Posts: 261 Rating: (42) |
hi Ninja Robot, Try the script. Dim Excel Dim XLS_File Dim SheetName Dim V(2) V(1) = HMIRuntime.Tags("File_name").Read V(2) = HMIRuntime.Tags("Sheet_name").Read XLS_File = V(1) SheetName = V(2) Set Excel = CreateObject("Excel.Application") Excel.Workbooks.Add Excel.Worksheets(1).Name = SheetName Excel.Worksheets(SheetName).range("A1") = "test by ddg" Excel.Worksheets(1).SaveAs (XLS_File) Excel.Quit Set Excel = Nothing //............ Also see the ref document. regards ddg Attachmentref.zip (1035 Downloads) |
This contribution was helpful to1 thankful Users |
7/30/2009 9:14 AM | |
Posts: 691 Rating: (37) |
Thanks For Replying I got my my Fault in my Script. I was not using ".Read" in the Tag Function for reading the value from the Tag |
8/12/2009 1:39 PM | |
Joined: 7/28/2009 Last visit: 5/10/2022 Posts: 90 Rating: (7) |
thanx... it works |
Cheers |
|
Follow us on