I built a COM OBJ script that pulls data value from excel. And it works.
I also have a script that finds a folder directory based on the first characters. It also works!
So now I want to combine them both to make a super mega ultra-powered bundle of scripting that will find my excel file in the database and extract its information.
I won't bore you with the first two scripts.
But here is what I got. It never finds the file, and the second msgbox always returns blank.
Code: Select all
!q::
inputbox, userinput, Enter Full Project ID, , ,300 ,100
; If the user pressed cancel or the string is too short
if (ErrorLevel || StrLen(userinput) = 0)
return
FoundFile := ""
Loop, Files, % "I:\My Drive\Webcam\Webcam - Projects\" SubStr(userinput, 1, 4) "\" SubStr(userinput, 1, 15) "*" "\"SubStr(userinput, 1, 15) "*".xlsl , FD
{
FoundFile := A_LoopFileFullPath
break
}
if (FoundFile != "")
Run, % FoundFile
Else
msgbox, I didn't find the file.
;IfExist, % "I:\My Drive\Webcam\Webcam - Projects\" SubStr(userinput, 1, 4) "\" SubStr(userinput, 1, 15) "*" "\" SubStr(userinput, 1, 15) "*".xlsl
msgbox, %foundfile%
return
My Database is sorted in this way.
Code: Select all
4 Digit State Code - 5 Digit project ID - company name - Business Name - address.
Code: Select all
TX15 - 78558 - Big business corporation - the business of typing, inc - 9506 Auto hotkey avenue
All projects have an excel sheet attached to it. Here's an example of the path I would be trying to find:
Code: Select all
I:\My Drive\Webcam\Webcam - Projects\TX15\TX15 - 78558 - Big business corporation - business of typing - 9506 Auto hotkey avenue\TX15 - 78558 - Big business corporation - the business of typing.xlsl
Disclaimer: I'm a newbie. 2nd month. doing AHK. So it's possible very obvious things are completely missed in here. Feel free to point them out. I will absorb all constructive information thrown my way.
Ice cream for everyone who pitches in!