Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Combobox output problem.
#2
Function SmartControl_getExcel_Sheetname
Code:
Copy      Help
function# [$ExcelFilePath] [$FileName] [#ID] [#hDlg]

int Excel_ListName Excel_SheetName

Dir ExcelData
str Excel_path Excel_name

foreach(ExcelData ExcelFilePath FE_Dir) ;;★★Path_Change★★
,Excel_path=ExcelData.FullPath;; out Excel_path
,if find(Excel_path FileName 0 1)>=0
,,out Excel_path
,,
,,SendMessage(id(ID hDlg) CB_RESETCONTENT 0 0) ;; Clean up combobox first
,,CB_Add(id(ID hDlg) "&전체")  ;; Then add this item
,,SendMessage(id(ID hDlg) CB_SETCURSEL 0 "") ;; make it as 1st item        
,,
,,ExcelSheet es.Init("" 8 Excel_path)
,,Excel.Application ea=es.ws.Application
,,Excel.Workbook wb
,,Excel.Worksheet ws
,,foreach wb ea.Workbooks
,,,str wbName=wb.Name
,,,int nSheets=wb.Worksheets.Count
,,,;out "%i worksheets in %s:" nSheets wbName
,,,foreach ws wb.Worksheets
,,,,str wsName=ws.Name
,,,,;out wsName

,,,,Excel_ListName=id(ID hDlg)
,,,,CB_Add(Excel_ListName wsName)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)