Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Print2PDF with "ChartTitle" as name

Hi guys.

I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Print2PDF with "ChartTitle" as name

SpeeD72,

Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.

Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True, _
collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

Kill (PSFileName)

End Sub

It creates a PDF just as if you chose to print to PDF
(ie printing boundries)

Dan E

"SpeeD72" wrote in message ...
Hi guys.

I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print2PDF with "ChartTitle" as name

hi Dan!

Thank´s a lot!! :-)

If i understand this macro gives me the possibility ti
print to PDF with the name chartTitlie.pdf, but what i
want is to use the Variable ChartTitle of a graph! (name
of the graph, that could change)

How can i do this?

Thanks
SpeeD


-----Original Message-----
SpeeD72,

Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at

someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.

Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True, _
collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

Kill (PSFileName)

End Sub

It creates a PDF just as if you chose to print to PDF
(ie printing boundries)

Dan E

"SpeeD72" wrote in message

...
Hi guys.

I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Print2PDF with "ChartTitle" as name

Great help, Thanks a lot!!!

It works´s just fine. :-)

By the way.... if i want to use a cell in the worksheet
inseat of the "charttitle", how can i do it?

thanks!

SpeeD72



-----Original Message-----
SpeeD,

Instead of using
PDFFileName = "c:\ChartTitle.pdf"
USE
If ActiveSheet.ChartObjects(1).Chart.ChartTitle.Text

< "" Then
PDFFileName = "C:\" & ActiveSheet.ChartObjects

(1).Chart.ChartTitle.Text & ".pdf"
Else
MsgBox Prompt:="Name your chart"
Exit Sub
End If

Adjust your ChartObjects # accordingly.

Dan E

"SpeeD" wrote in message

...
hi Dan!

Thank´s a lot!! :-)

If i understand this macro gives me the possibility ti
print to PDF with the name chartTitlie.pdf, but what i
want is to use the Variable ChartTitle of a graph! (name
of the graph, that could change)

How can i do this?

Thanks
SpeeD


-----Original Message-----
SpeeD72,

Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at

someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.

Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True, _
collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

Kill (PSFileName)

End Sub

It creates a PDF just as if you chose to print to PDF
(ie printing boundries)

Dan E

"SpeeD72" wrote in message

...
Hi guys.

I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in

other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.


.



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Print2PDF with "ChartTitle" as name

If Range("A1").Value < "" Then
PDFFileName = "C:\" & Range("A1").Value & ".pdf"
Else
MsgBox Prompt:="Insert a Name in A1"
Exit Sub
End If

Change A1 to your desired cell accordingly

Dan E

"SpeeD72" wrote in message ...
Great help, Thanks a lot!!!

It works´s just fine. :-)

By the way.... if i want to use a cell in the worksheet
inseat of the "charttitle", how can i do it?

thanks!

SpeeD72



-----Original Message-----
SpeeD,

Instead of using
PDFFileName = "c:\ChartTitle.pdf"
USE
If ActiveSheet.ChartObjects(1).Chart.ChartTitle.Text

< "" Then
PDFFileName = "C:\" & ActiveSheet.ChartObjects

(1).Chart.ChartTitle.Text & ".pdf"
Else
MsgBox Prompt:="Name your chart"
Exit Sub
End If

Adjust your ChartObjects # accordingly.

Dan E

"SpeeD" wrote in message

...
hi Dan!

Thank´s a lot!! :-)

If i understand this macro gives me the possibility ti
print to PDF with the name chartTitlie.pdf, but what i
want is to use the Variable ChartTitle of a graph! (name
of the graph, that could change)

How can i do this?

Thanks
SpeeD


-----Original Message-----
SpeeD72,

Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at

someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.

Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True, _
collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

Kill (PSFileName)

End Sub

It creates a PDF just as if you chose to print to PDF
(ie printing boundries)

Dan E

"SpeeD72" wrote in message

...
Hi guys.

I need to print a sheet that contains a Graph (pie), and
the respective values (tabel) to PDF, to be used in

other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.


.



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Print2PDF with "ChartTitle" as name

Works perfect!

Thanks a lot! i´ve been great!

SpeeD72



-----Original Message-----
If Range("A1").Value < "" Then
PDFFileName = "C:\" & Range("A1").Value & ".pdf"
Else
MsgBox Prompt:="Insert a Name in A1"
Exit Sub
End If

Change A1 to your desired cell accordingly

Dan E

"SpeeD72" wrote in message

...
Great help, Thanks a lot!!!

It works´s just fine. :-)

By the way.... if i want to use a cell in the worksheet
inseat of the "charttitle", how can i do it?

thanks!

SpeeD72



-----Original Message-----
SpeeD,

Instead of using
PDFFileName = "c:\ChartTitle.pdf"
USE
If ActiveSheet.ChartObjects(1).Chart.ChartTitle.Text

< "" Then
PDFFileName = "C:\" & ActiveSheet.ChartObjects

(1).Chart.ChartTitle.Text & ".pdf"
Else
MsgBox Prompt:="Name your chart"
Exit Sub
End If

Adjust your ChartObjects # accordingly.

Dan E

"SpeeD" wrote in message

...
hi Dan!

Thank´s a lot!! :-)

If i understand this macro gives me the possibility ti
print to PDF with the name chartTitlie.pdf, but what i
want is to use the Variable ChartTitle of a graph! (name
of the graph, that could change)

How can i do this?

Thanks
SpeeD


-----Original Message-----
SpeeD72,

Following is a macro to print to pdf however you like.
I will take no credit for the code (I found it at

someones
website but don't quite remember whos???). You need
to add references to "AcrobatPDFMaker" and
"AcrobatDistiller" to your project.

Sub Print_PDF()
' Define the postscript and .pdf file names.
Dim PSFileName As String
Dim PDFFileName As String
PSFileName = "c:\myPostScript.ps"
PDFFileName = "c:\ChartTitle.pdf"

' Print the Excel range to the postscript file
Dim MySheet As Worksheet
Set MySheet = ActiveSheet
ActiveSheet.PrintOut copies:=1, preview:=False, _
ActivePrinter:="Acrobat Distiller", printtofile:=True,

_
collate:=True, prtofilename:=PSFileName

' Convert the postscript file to .pdf
Dim myPDF As PdfDistiller
Set myPDF = New PdfDistiller
myPDF.FileToPDF PSFileName, PDFFileName, ""

Kill (PSFileName)

End Sub

It creates a PDF just as if you chose to print to PDF
(ie printing boundries)

Dan E

"SpeeD72" wrote in

message
...
Hi guys.

I need to print a sheet that contains a Graph (pie),

and
the respective values (tabel) to PDF, to be used in

other
programs. It´s essecial that the name of the PDF is
the "ChartTitle", and this as to be autumatic, becouse
theres a lot of PDF´s to be made...

Thanks a lot!!!!!!!!!
SpeeD72

P.S: i use PDF becuuse it retains the objects
as "curves", and can be used in other Design progs.


.



.



.

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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Print 2 PDF with "ChartTitle".pdf as name.... SpeeD72 Excel Programming 0 September 8th 03 06:31 PM


All times are GMT +1. The time now is 11:58 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"