Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as pdf with special name
Hi,
I'm trying to save a sheet with a namn from the sheet as a pdf. Do anyone know what I should change in my code below to make it work? Sub Saveas() ' Saveas Makro ' ' Dim Namn As Integer Sheets("Blad2").Select Namn = Range("A1").Value ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "M:\mc\Fevis\Namn.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Sheets("Blad1").Select End Sub BR Mia |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as pdf with special name
Use this
You can remove the date/time stamp if you want Sub RDB_PDF_ActiveSheet() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = Application.DefaultFilePath & "\" & _ ActiveSheet.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi, I'm trying to save a sheet with a namn from the sheet as a pdf. Do anyone know what I should change in my code below to make it work? Sub Saveas() ' Saveas Makro ' ' Dim Namn As Integer Sheets("Blad2").Select Namn = Range("A1").Value ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "M:\mc\Fevis\Namn.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Sheets("Blad1").Select End Sub BR Mia |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as pdf with special name
Hi Ron,
It did not solve my problem completely. I want the pdf to always be saved at the sam place. M:\mc\Fevis\ And I also want the name to be from one cell in the active sheet. Is it possible? BR Mia "Ron de Bruin" skrev: Use this You can remove the date/time stamp if you want Sub RDB_PDF_ActiveSheet() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = Application.DefaultFilePath & "\" & _ ActiveSheet.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi, I'm trying to save a sheet with a namn from the sheet as a pdf. Do anyone know what I should change in my code below to make it work? Sub Saveas() ' Saveas Makro ' ' Dim Namn As Integer Sheets("Blad2").Select Namn = Range("A1").Value ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "M:\mc\Fevis\Namn.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Sheets("Blad1").Select End Sub BR Mia |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as pdf with special name
Use this then
Sub RDB_PDF_ActiveSheet_2() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = "M:\mc\Fevis\" & _ ActiveSheet.Range("A1").Value & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi Ron, It did not solve my problem completely. I want the pdf to always be saved at the sam place. M:\mc\Fevis\ And I also want the name to be from one cell in the active sheet. Is it possible? BR Mia "Ron de Bruin" skrev: Use this You can remove the date/time stamp if you want Sub RDB_PDF_ActiveSheet() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = Application.DefaultFilePath & "\" & _ ActiveSheet.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi, I'm trying to save a sheet with a namn from the sheet as a pdf. Do anyone know what I should change in my code below to make it work? Sub Saveas() ' Saveas Makro ' ' Dim Namn As Integer Sheets("Blad2").Select Namn = Range("A1").Value ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "M:\mc\Fevis\Namn.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Sheets("Blad1").Select End Sub BR Mia |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save as pdf with special name
Hi Ron,
You are briliant! Thank you wery much! BR Mia "Ron de Bruin" skrev: Use this then Sub RDB_PDF_ActiveSheet_2() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = "M:\mc\Fevis\" & _ ActiveSheet.Range("A1").Value & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi Ron, It did not solve my problem completely. I want the pdf to always be saved at the sam place. M:\mc\Fevis\ And I also want the name to be from one cell in the active sheet. Is it possible? BR Mia "Ron de Bruin" skrev: Use this You can remove the date/time stamp if you want Sub RDB_PDF_ActiveSheet() Dim FilenameStr As String If Dir(Environ("commonprogramfiles") & "\Microsoft Shared\OFFICE" _ & Format(Val(Application.Version), "00") & "\EXP_PDF.DLL") < "" Then FilenameStr = Application.DefaultFilePath & "\" & _ ActiveSheet.Name & " " & Format(Now, "dd-mmm-yy h-mm-ss") & ".pdf" ActiveSheet.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=FilenameStr, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False MsgBox "You can find the PDF file here : " & FilenameStr Else MsgBox "PDF add-in Not Installed" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Mia" wrote in message ... Hi, I'm trying to save a sheet with a namn from the sheet as a pdf. Do anyone know what I should change in my code below to make it work? Sub Saveas() ' Saveas Makro ' ' Dim Namn As Integer Sheets("Blad2").Select Namn = Range("A1").Value ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _ "M:\mc\Fevis\Namn.pdf", Quality:=xlQualityStandard, _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ False Sheets("Blad1").Select End Sub BR Mia |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replace special character for filename save | Excel Programming | |||
formula to save value of cell w/o copy- paste special-value | Excel Programming | |||
Save Special Filename Multiple Times | Excel Programming | |||
Excel Save As... text with special characters | Excel Discussion (Misc queries) | |||
Urgent! Save Excel WorkBook - a special way | Excel Programming |