Is it possible to create a folder and save the worksheet as pdf?
Create folder and save worksheet as pdf
-
-
-
Re: Create folder and save worksheet as pdf
Ron de Bruin has selection of code for creating pdfs
-
Re: Create folder and save worksheet as pdf
Thanks royUK
Running Excel 2013
I have look at a lot of examples and can not find what I want. When I click on a button it will-
1. go to the folder(Folder value is in C13)
2. put the file name in the file dialog box with the value in C16
3. Save to the folder as a pdf. -
Re: Create folder and save worksheet as pdf
This is a code I use to make a Folder named what ever is on B2
-
Re: Create folder and save worksheet as pdf
Thanks davesexcel
not have problem with making folder, having problem with saving the worksheet as pdf in the right folder. C13 is the folder name and c16 is the workbook name. Want to
click button and open to correct folder by value in C13 and the workbook name in C16 is in the save as dialog box to save as PDF. Here is what I use to make folderCode
Display MoreDim sFolder As String, e With CreateObject("vbscript.regexp") .Global = True .Pattern = "[\/\*\.\\""""]+" For Each e In Array(vbNullString, "EMAIL", "Brand", "PDF", "PROPOSAL", "Today") sFolder = "C:\Users\Tom\Dropbox\Sales\" & .Replace(Range("C13").Value, vbNullString) & "\" & e If Dir(sFolder, vbDirectory) = vbNullString Then MkDir sFolder Next e End With
-
-
Re: Create folder and save worksheet as pdf
Okay,
Well here is what I use to PDF my workbookCodeDim d As String, s As String, ds As String s = "S:\Stairs\Stair Productions\" d = Range("B2") ds = s & d ChDir "S:\" ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ ds & "\" & d & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, _ IgnorePrintAreas:=False, OpenAfterPublish:=True
-
Re: Create folder and save worksheet as pdf
Thanks davesexcel, minor change and works perfect.
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!