Hi All,
I currently have a script that opens an excel using the following format:
run \\Server001\Documents\MAINFILE.xlsx
However, the file now has random text added to the filename (I cannot control the naming of the file).
For example the filename might be "MAINFILE ABC.xlsx" one moment and then "MAINFILE A1B2XY57.xlsx" the next.
Is it possible to open an excel using a wildcard so that "MAINFILE *.xlsx" or something similar would work?
Kind Regards,
jmcall10
open excel file using wildcard
Re: open excel file using wildcard
Code: Select all
Loop, Files, \\Server001\Documents\MAINFILE*.xlsx
{
MsgBox % A_LoopFileFullPath
}
Re: open excel file using wildcard
Looks like awel20 finished before me, but here's what I was going to suggest:
Code: Select all
#SingleInstance, Force
Loop, Files, \\Server001\Documents\*.xlsx, F
{
If (InStr(A_LoopFileLongPath, "MAINFILE")) {
Run, % A_LoopFileLongPath
Break
}
}
Re: open excel file using wildcard
Excellent! I shall give these a go and feedback.
Re: open excel file using wildcard
Worked a treat!
Who is online
Users browsing this forum: Google [Bot], Joey5 and 293 guests