I like to key in the date in DD/MM/YYYY format in 2 cells of an excel worksheet. Here's my code.
Code: Select all
Inputbox, inputpath,, FPfile:,,200,120
Inputbox, inputpath2,, PHfile:,,200,120
Path := inputpath
Path2 := inputpath2
PHfile :=ComObjcreate("Excel.Application")
PHfile.visible := true
PHfile.Workbooks.Open(Path2)
FPfile:=ComObjcreate("Excel.Application")
FPfile.visible := True
FPfile.Workbooks.Open(Path)
FPfile.WorkSheets("27_Signature").Range("B19:J20").value := %a_longdate%
FPfile.WorkSheets("27_Signature").Range("V34:AD36").value := %a_longdate%
PHfile.DisplayAlerts:=false
PHfile.Application.CutCopyMode:=False
PHfile.Workbooks.Close()
PHfile.quit()
PHfile:=""
FPfile.quit()
I tried a few variations fromthe system date variable, like a_MM, or a_longdate, and sometimes with or without the percentage sign, but always run into some kind of script error, or either the data was not properly rendered in excel (hit or miss, with partial characters or sometimes jibberish)
Can ask for your input? It will also be great if text expander strings can be used as value for these cells value.
Thanks in advance.