上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
wsk
註冊時間: 2004-01-14 文章: 51
第 1 樓
|
發表於: 星期六 七月 09, 2005 10:52 am 文章主題: Excel 在 VFP 的讀取問題 |
|
|
請各位大大幫忙,
有一個 Excel 檔案, 內有多張 sheet, 每一張 sheet 都有一個名稱, 例如 "東南31", "雅達22" 等等,
請問怎樣可以在 VFP 內讀取每一張 sheet 的名稱及讓使用者決定匯入那幾張 sheets. 謝謝 |
|
回頂端 |
|
|
garfield Site Admin
註冊時間: 2003-01-30 文章: 2157
第 2 樓
|
|
回頂端 |
|
|
wsk
註冊時間: 2004-01-14 文章: 51
第 3 樓
|
發表於: 星期五 七月 22, 2005 7:05 pm 文章主題: |
|
|
謝謝 garfield 的回答. 我到現在仍未能解決此問題 -- 在不知道 Excel 檔內有多少張 sheets, 用VFP來讀取每一張 sheet 的名稱時,
會出現錯誤訊息. |
|
回頂端 |
|
|
wsk
註冊時間: 2004-01-14 文章: 51
第 4 樓
|
發表於: 星期五 七月 22, 2005 7:28 pm 文章主題: |
|
|
如可以知道該 Excel 檔有多少張 sheets 就可以解決此問題. |
|
回頂端 |
|
|
garfield Site Admin
註冊時間: 2003-01-30 文章: 2157
第 5 樓
|
發表於: 星期五 七月 22, 2005 9:36 pm 文章主題: |
|
|
Objectexecl = createobject('excel.application')
with Objectexecl
.workbooks.open('xls檔案名')
mcount = .sheets.count
for i=1 to mcount
? .sheets(i).name
next
with _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
|
wsk
註冊時間: 2004-01-14 文章: 51
第 6 樓
|
發表於: 星期日 七月 24, 2005 11:05 am 文章主題: |
|
|
謝謝 garfield, 按您的指導, 已OK. |
|
回頂端 |
|
|
richshih
註冊時間: 2007-10-11 文章: 153
第 7 樓
|
發表於: 星期四 十月 23, 2008 2:39 pm 文章主題: |
|
|
garfield 寫到: | Objectexecl = createobject('excel.application')
with Objectexecl
.workbooks.open('xls檔案名')
mcount = .sheets.count
for i=1 to mcount
? .sheets(i).name
next
with |
請問garfield 如何知道 那一個SHEETS 是目前作用中的(ACTIVATE) SHEET |
|
回頂端 |
|
|
garfield Site Admin
註冊時間: 2003-01-30 文章: 2157
第 8 樓
|
發表於: 星期四 十月 23, 2008 3:47 pm 文章主題: |
|
|
.ActiveSheet.name _________________ 利用>>搜尋<<的功能會比問的還要快得到答案. |
|
回頂端 |
|
|
richshih
註冊時間: 2007-10-11 文章: 153
第 9 樓
|
發表於: 星期四 十月 23, 2008 5:35 pm 文章主題: |
|
|
garfield 寫到: | .ActiveSheet.name |
THANKS |
|
回頂端 |
|
|
|