Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Mia Mia is offline
external usenet poster
 
Posts: 101
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replace special character for filename save anduare2 Excel Programming 10 April 21st 08 03:12 PM
formula to save value of cell w/o copy- paste special-value BILL SPF Excel Programming 1 January 11th 08 07:18 PM
Save Special Filename Multiple Times DTTODGG Excel Programming 1 October 3rd 06 07:47 PM
Excel Save As... text with special characters Brynturk Excel Discussion (Misc queries) 2 June 23rd 05 02:59 AM
Urgent! Save Excel WorkBook - a special way Anirban Excel Programming 1 May 25th 04 02:55 PM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"