XL.ActiveWorkbook.SaveAs() use string as title? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
ivill
Posts: 124
Joined: 13 May 2016, 02:23

XL.ActiveWorkbook.SaveAs() use string as title?

21 Sep 2017, 04:11

Code: Select all

Loop F:\
{
 If ( A_LoopFileTimeModified >= Time )
{
    Time := A_LoopFileTimeModified
    File := A_LoopFileLongPath
    Filename := A_LoopFileName
}
}
StringTrimRight, Filename, Filename, 4
Sleep 300
if( RegExMatch(Filename, "(.*?)(\d+)$", spli) )
Sleep 300
spli2 := spli2 +1
;
;balabalabala
;
XL.ActiveWorkbook.SaveAs("F:\spli1 . spli2", 56)

how do i put the %spli1%%spli2% as the title while save it as a new .xls?

neither XL.ActiveWorkbook.SaveAs("F:\spli1 . spli2", 56) nor XL.ActiveWorkbook.SaveAs("F:\%spli1%%spli2%", 56) works... (it creates a .xls file called spli1 . spli2 or %spli1%%spli2% :? )

could someone point out the mistake, thanks! :thumbup:
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: XL.ActiveWorkbook.SaveAs() use string as title?  Topic is solved

21 Sep 2017, 05:54

XL.ActiveWorkbook.SaveAs("F:\" . spli1 . spli2 . ".xls", 56)
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
User avatar
ivill
Posts: 124
Joined: 13 May 2016, 02:23

Re: XL.ActiveWorkbook.SaveAs() use string as title?

21 Sep 2017, 06:34

Blackholyman wrote:XL.ActiveWorkbook.SaveAs("F:\" . spli1 . spli2 . ".xls", 56)
it works like a charm, thanks! @blackholyman

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], wilkster and 309 guests