作者kinbaku1 (~GUCCI BOY~)
看板Office
標題[算表] VBA讀取資料夾的圖片
時間Mon May 16 22:46:02 2016
軟體:office excel word
版本:2010
想請教版上高手
因為我想要讀取圖片匯入我的檔案裡
Dim oFl As File
Dim oFldr As Folder
Dim fso As New FileSystemObject
strFileLocation = ActiveDocument.Path
strFileLocation = "d:\pic"==>這裡是直接去開D槽的pic
Set oFldr = fso.GetFolder(strFileLocation)
想請問一下,我如果是想要自己開我自己執行後去選取的檔案
類似我們做"開啟舊檔"這個方法
去選我們要開的檔案或資料夾
在這個地方要怎麼改會比較好呢?
謝謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.240.215.79
※ 文章網址: https://www.ptt.cc/bbs/Office/M.1463409965.A.CED.html
→ soyoso: application.filedialog() 05/16 23:04
→ soyoso: 資料夾msofiledialogfolderpicker 05/16 23:05
→ soyoso: 檔案msofiledialogfilepicker 05/16 23:05
→ soyoso: 跳出視窗以show,取得選取的路徑&子目錄或檔名以 05/16 23:08
→ soyoso: selecteditems 05/16 23:08
→ kinbaku1: 謝謝s大大,可以用了3Q~ 05/16 23:43