use inputbox to open excel file please help Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
adrian_9382
Posts: 11
Joined: 02 Oct 2017, 02:24

use inputbox to open excel file please help

03 Oct 2017, 08:00

hi all , i am a beginning student .
i design a script to get xls value to search but existing path is fixed , i hope use inputbox to input xls path and always select the excel sheets1 for start page to get value


what can i do ................ please help ............




filepath:=A_ScriptDir "\"
InputBox,_filepath,Open excel file!,please input xls path ,,300,200,,,,15,%filepath%

objExcel := ComObjCreate("Excel.Application")
;objWorkbook := ("C:\Users\adrian\Desktop\test.xls")
objWorkbook := objExcel.Workbooks.Open, %filepath% ;*************don't working

X=1
loop
{
strCell := objExcel.Cells(X, 1).Value
MsgBox, % strCell

;run notepad
;click 287,880
;sleep,1000
;click 436,156
;send, ^a
;send, {delete}
;Send, % strCell
;send, {enter}
;sleep,6000

;;;;do-something;;;;;;

x:=x+1
if (strcell =""){
return
}
}


return
exitapp
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: use inputbox to open excel file please help  Topic is solved

03 Oct 2017, 08:09

how about

Code: Select all

FileSelectFile, filepath
objExcel := ComObjCreate("Excel.Application")
;objWorkbook := ("C:\Users\adrian\Desktop\test.xls")
objWorkbook := objExcel.Workbooks.Open(filepath)
?
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
adrian_9382
Posts: 11
Joined: 02 Oct 2017, 02:24

Re: use inputbox to open excel file please help

03 Oct 2017, 08:26

omg ! thank you this amazing ! but i have a question . if i use fied path to open xls the msgbox show value is 126 why use fileselectfile show value is 126.000000
how can show interger

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 71 guests