不使用对话框Excel VBA将网页打印为pdf

不使用对话框Excel VBA将网页打印为pdf,vba,pdf,web-scraping,Vba,Pdf,Web Scraping,我正在尝试使用VBA将网页下载到pdf。我尝试了下面的方法,这会提示我选择要下载的文件夹和文件名 有没有一种方法可以让我在没有任何提示/对话框的情况下提前选择文件夹并自动保存网页 Sub printpdf() URL = "https://www.londonstockexchange.com/news-article/CTEC/q1-trading-update/14956551" Set IE = CreateObject("InternetExplorer.A

我正在尝试使用VBA将网页下载到pdf。我尝试了下面的方法,这会提示我选择要下载的文件夹和文件名

有没有一种方法可以让我在没有任何提示/对话框的情况下提前选择文件夹并自动保存网页

Sub printpdf()
URL = "https://www.londonstockexchange.com/news-article/CTEC/q1-trading-update/14956551"
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate (URL)
IE.StatusBar = False
IE.Toolbar = True
IE.Visible = True
IE.resizable = True
IE.AddressBar = False
    
TimeOutWebQuery = 5
TimeOutTime = DateAdd("s", TimeOutWebQuery, Now)
Do Until IE.readyState = 4
    DoEvents
    If Now > TimeOutTime Then
        IE.stop
        GoTo ErrorTimeOut
    End If
Loop

IE.ExecWB 6, 2
Application.Wait (Now + TimeValue("0:00:03"))

ErrorTimeOut:

Set IE = Nothing
End Sub