[VBA] URLを開くマクロ
今回紹介する以外にも方法はあるのですが、そっちだとURLが開くまでEXCELが待ち状態になるので
違う方法を紹介します。
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub OpenURL(strURL as string)
call ShellExecute(0, "Open", strURL, "", "", 1)
End Sub
このOpenURLという関数を使って下さい。
開くのに時間が掛かるURLでもExcelが止まることはありません。
参考になれば幸いです
違う方法を紹介します。
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub OpenURL(strURL as string)
call ShellExecute(0, "Open", strURL, "", "", 1)
End Sub
このOpenURLという関数を使って下さい。
開くのに時間が掛かるURLでもExcelが止まることはありません。
参考になれば幸いです