@note_korean
Next time, please provide executable code in your questions.
Answering questions with incomplete code snippets requires a lot of inference, which may not be appropriate. Thank you.
다음부터는 실행 가능한 코드로 질문 글을 작성해 주세요.
코드가 불완전하면 여러모로 유추해야 할 것이 많아 답변드리기에 적절치 않습니다. 감사합니다.
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
myGui := gui()
editPath := myGui.add("Edit", "w400 ReadOnly")
btnFindExcel := myGui.add("Button", "w400", "Find Excel")
btnFindExcel.onEvent("Click", btnFindExcel_Click)
btnExcelSetting := myGui.add("Button", "w400", "Excel Setting")
btnExcelSetting.onEvent("Click", btnExcelSetting_Click)
myGui.show()
btnFindExcel_Click(guiCtrlObj, info) {
global editPath
filename := fileSelect(1|2, A_ScriptDir, "Open a input Excel file, Excel files(*.xlsx)")
if (filename = "")
msgBox "You didn't select a file"
else
editPath.Text := filename
}
btnExcelSetting_Click(guiCtrlObj, info) {
where := editPath.Text
if (where = "")
return
aexcel1 := comObject("Excel.Application")
sleep 50
aexcel1.Workbooks.open(where)
sleep 50
aexcel1.Visible := true
sleep 50
}
Code: Select all
#Requires AutoHotkey v1.1
#SingleInstance Force
gui Add, Edit, w400 ReadOnly veditPath
gui Add, Button, w400 ggButtonFindExcel, Find Excel
gui Add, Button, w400 ggButtonExcelSetting, Excel Setting
gui Show
return
gButtonFindExcel:
fileSelectFile filename, % 1|2, %A_ScriptDir% , Open a input Excel file, Excel files(*.xlsx)
if (filename = "")
msgBox You didn't select a file
else
guiControl,, editPath, %filename%
return
gButtonExcelSetting:
gui Submit, Nohide
where := editPath
if (where = "")
return
aexcel1 := comObjCreate("Excel.Application")
sleep 50
aexcel1.Workbooks.open(where)
sleep 50
aexcel1.Visible := true
sleep 50
return