Hi
I want to save "sheet2" as a PFD file. I use excel 2007, and my code isn't working and I can't figure out why.
I wrote this code:
I strongly believe it's the way to do this but I get the "Expected:=" error message......Public Sub savepage() Dim name As String '///the name is the path for the new file plus dateisMMDDYYYY for a variable date which is located in sheet2 the U6 cell name = "C:\Documents and Settings\user\"dateis" & Sheet2.Range("U6").Value & ".pdf" sheet2.ExportAsFixedFormat(xlTypePDF,name,xlQualityStandard) End Sub
I don't know what to do please help me!!!
Benedict
Last edited by benedictexcel; 02-03-2012 at 03:46 PM.
I suspect it may be that "name" is a reserved word so change that first.
But ...
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
sorry, I didn't know that rule, I changed it.
I changed "name" for "nameofthefile" and it still ain't working
I just recorde a macro to publish a .pdf file.
ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:="C:\Users\...\Documents\Book1.pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False
I'd go with:
but not testedsName = "C:\Documents and Settings\user\dateis" & Sheets("Sheet2").Range("U6").Value & ".pdf"
Regards, TMS
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks