![]() |
#1
|
|||
|
|||
![]()
I'm trying to create macro that will update and existing Word document which has embedded Excel objects into a PDF with a date stamp at the end of its name. The macro works good until today when I opened the PDF I receive an error that reads "Adobe Reader could not open 'Weekly Report_0618.pdf' because it is either not a supported file type or because the file has been damaged..." Please let me know what I'm doing wrong.
Sub OpenWordDoc() Dim filename, filepath Dim objWord Dim objDoc Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Open("H:\Weekly\Weekly Report.docx") objWord.Visible = True objDoc.Fields.Update Application.DisplayAlerts = False filepath = "Z:\00_Weekly Forecast\" filename = "Weekly Report_" & InputBox("Enter Forecast Date") & ".pdf" objDoc.SaveAs filepath & filename Application.DisplayAlerts = True objDoc.Close End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Save an excel file with a macro ? | nospamdav999 | Excel | 0 | 05-09-2017 01:11 PM |
![]() |
DefinedDesign | Word VBA | 9 | 10-29-2014 01:48 PM |
![]() |
gbaker | Excel Programming | 28 | 07-22-2014 03:54 PM |
![]() |
rosscortb | Word VBA | 5 | 05-19-2014 08:40 AM |
![]() |
jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |