I was wondering if anyone could help. I want to open a website and save the image that opens as a pdf. My code is below and when i save it to a pdf w/ current code, nothing shows up in the pdf file that is save. Its as if the file is corrupted or something. Anyone have any thoughts?
Sub CallWebPage()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
Dim newdate As Date
Dim StartTime As Date
Dim MinutesElapsed As Double
StartTime = Now()
Call makefolder(newdate)
Dim OpenPlace As String
Dim SavePlaceAlt As String
SavePlace = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy") & "\"
OpenPlace = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy") & "\"
Dim ManEmp As String
Dim Mort_30_yr As String
Oil_Price_Forcast = "https://www.dallasfed.org/research/...ch/surveys/des/2019/1904/des1904forecast1.png"
ActiveWorkbook.FollowHyperlink _
Address:=Oil_Price_Forcast, _
NewWindow:=True, _
AddHistory:=True
Application.WindowState = xlNormal
ActiveWorkbook.SaveAs filename:=SavePlace & "Oil Price Forcast " & Format(newdate, "mm-dd-yyyy") & ".pdf" ' , FileFormat:=51
ActiveWorkbook.Close
End Sub
Sub makefolder(newdate)
Dim filename As String
Dim zfilename As String
If Weekday(Now(), vbMonday) = 1 Then
newdate = Now() - 3
Else
newdate = Now() - 1
End If
filename = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy")
zfilename = Dir(filename, vbDirectory)
If zfilename = "" Then
MkDir ("T:\Daily Downloads\Fed Reserve\") & Format(newdate, "mm-dd-yyyy")
Else
Exit Sub
End If
End Sub
Sub CallWebPage()
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
Dim newdate As Date
Dim StartTime As Date
Dim MinutesElapsed As Double
StartTime = Now()
Call makefolder(newdate)
Dim OpenPlace As String
Dim SavePlaceAlt As String
SavePlace = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy") & "\"
OpenPlace = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy") & "\"
Dim ManEmp As String
Dim Mort_30_yr As String
Oil_Price_Forcast = "https://www.dallasfed.org/research/...ch/surveys/des/2019/1904/des1904forecast1.png"
ActiveWorkbook.FollowHyperlink _
Address:=Oil_Price_Forcast, _
NewWindow:=True, _
AddHistory:=True
Application.WindowState = xlNormal
ActiveWorkbook.SaveAs filename:=SavePlace & "Oil Price Forcast " & Format(newdate, "mm-dd-yyyy") & ".pdf" ' , FileFormat:=51
ActiveWorkbook.Close
End Sub
Sub makefolder(newdate)
Dim filename As String
Dim zfilename As String
If Weekday(Now(), vbMonday) = 1 Then
newdate = Now() - 3
Else
newdate = Now() - 1
End If
filename = "T:\Daily Downloads\Fed Reserve\" & Format(newdate, "mm-dd-yyyy")
zfilename = Dir(filename, vbDirectory)
If zfilename = "" Then
MkDir ("T:\Daily Downloads\Fed Reserve\") & Format(newdate, "mm-dd-yyyy")
Else
Exit Sub
End If
End Sub