「VBA」修訂間的差異

出自ProgWiki
跳至導覽 跳至搜尋
 
(未顯示同一使用者於中間所作的 8 次修訂)
行 1: 行 1:
'''VBA'''(Visual Basic for Applications),{{wikipedia|Visual_Basic_for_Applications|lang=en}}
+
'''VBA'''(Visual Basic for Applications)
 +
*{{wikipedia|Visual_Basic_for_Applications|lang=en}}
 +
*{{wikibooks|Visual_Basic_for_Applications|lang=en}}
  
==參考資料==
+
==技術文件==
 
*[https://docs.microsoft.com/zh-tw/office/vba/api/overview/ Office VBA 參考]
 
*[https://docs.microsoft.com/zh-tw/office/vba/api/overview/ Office VBA 參考]
 
**[https://docs.microsoft.com/zh-tw/office/vba/language/reference/functions-visual-basic-for-applications 函數]
 
**[https://docs.microsoft.com/zh-tw/office/vba/language/reference/functions-visual-basic-for-applications 函數]
 +
 +
;其他
 +
*[https://excelmacromastery.com/vba-class-modules/ VBA Class Modules - The Ultimate Guide - Excel Macro Mastery]
  
 
==FAQ==
 
==FAQ==
===取得資料夾路徑===
+
===從剪貼簿讀取字串===
*原始出處: [https://stackoverflow.com/questions/28054713/folder-picker-for-ms-word Folder Picker for MS Word]
+
*[https://docs.microsoft.com/zh-tw/office/vba/access/concepts/windows-api/retrieve-information-from-the-clipboard 從剪貼簿擷取資訊]
<source lang="vb">
+
===【Microsoft HTML Object Library】與【Microsoft Internet Controls】應用===
Function GetFolder(strPath As String) As String
+
*[[Mshtml.tlb]]、[[Shdocvw.dll]]
    Dim fldr As FileDialog
+
*[https://p2p.wrox.com/excel-vba/20672-problem-using-mshtml.html Problem using MSHTML]
    Dim sItem As String
+
*[http://learnexcelmacro.com/wp/2012/01/how-to-login-to-gmail-from-excel-macro/ How to interact with HTML pages from Excel]
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
+
*[http://exceldevelopmentplatform.blogspot.com/2018/01/vba-mshtml-webscraping-looking-for-new.html VBA MSHTML Webscraping - Looking for a New Oven]
    With fldr
+
*[[Word#.E5.A4.A7.E9.87.8F.E6.93.B7.E5.8F.96.E6.9F.90.E7.B6.B2.E7.AB.99.E7.9A.84.E6.96.87.E5.AD.97.E5.85.A7.E5.AE.B9.28.E5.BC.B7.E5.8C.96.E7.89.882.29|大量擷取某網站的文字內容(強化版2)]] (Word)
        .Title = "Select a Folder"
+
 
        .AllowMultiSelect = False
+
==相關==
        .InitialFileName = strPath
+
*[[Scrrun.dll]]
        If .Show <> -1 Then GoTo NextCode
 
        sItem = .SelectedItems(1)
 
    End With
 
NextCode:
 
    GetFolder = sItem
 
    Set fldr = Nothing
 
End Function
 
</source>
 
  
 
[[分類:Microsoft Office]]
 
[[分類:Microsoft Office]]
 
[[分類:Script語言]]
 
[[分類:Script語言]]
 +
[[分類:VBA]]
 +
[[分類:BASIC程式語言家族]]

於 2021年10月27日 (三) 14:18 的最新修訂