Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting date from a Excel range
#1
Guys,

In a Excel file, Sheet1, cel D13, i have a date (Ex. 13/05/2015).

How can I rename this file, without opening it, using that date, like "FileName_2015_05_13.xls" ?

Thank you.
#2
Macro Macro2705
Code:
Copy      Help
str file="$documents$\Book1.xls"

ExcelSheet e.Init("Sheet1" 8 file)
str s=e.Cell("D13")
e.Close
;out s
str path.getpath(file) name.getfilename(file) ext.GetFilenameExt(file)
s.ReplaceInvalidFilenameCharacters("_")
str name2.from(name "_" s "." ext)
;out name2
ren* file name2
#3
Perfect.Thank you again. Your support is always perfect.


Forum Jump:


Users browsing this thread: 1 Guest(s)