

Getting Started Automating ExcelĪre you new to VBA and not sure where to begin? Check out my quickstart guide to learning VBA. Now that you’ve found some VBA code that could potentially solve your Excel automation problem, what do you do with it? If you don’t necessarily want to learn how to code VBA and are just looking for the fastest way to implement this code into your spreadsheet, I wrote an article (with video) that explains how to get the VBA code you’ve found running on your spreadsheet. Microsoft PowerPoint Version Using VBA Code Found On The Internet The links to those specific posts are as follows: Upon request, I have made similar macros for other Office Applications you may use on a regular basis to convert their files into PDF documents.

Same Macro Functionality For Other Office Applications " by the original PDF file already being open." MsgBox "There was a problem saving your PDF. MsgBox "PDF Saved in the Folder: " & FolderName

OutputFileName:=CurrentFolder & FileName & ".pdf", _įolderName = Mid(.Path, InStrRev(.Path, "\") + 1, Len(.Path) - InStrRev(.Path, "\")) Loop While ValidFileName(FileName) = False If FileName = "False" Or FileName = "" Then Exit Sub "(will ask again if you provide an invalid file name)", _ Click to Rename.", vbYesNoCancel)įileName = InputBox("Provide New File Name " & _ UserAnswer = MsgBox("File Already Exists! Click " & _ InStrRev(myPath, ".") - InStrRev(myPath, "\") - 1)ĭirFile = CurrentFolder & FileName & ".pdf" 'NOTES: PDF Will Be Saved To Same Folder As Word Document FileĬurrentFolder = ActiveDocument.Path & "\"įileName = Mid(myPath, InStrRev(myPath, "\") + 1, _ 'PURPOSE: Generate A PDF Document From Current Word Document
