Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default automate save as of excel-report to pdf-document.

Hi,

I have inherited an excel-report which I would like to automate. Every day I
need to
save in pdf-format around 12 reports from 12 different selections in a
drop-down list (I am not sure it is a drop-down list but it looks like that).

Is it possible to automatically do the following: 1) Da a selection for each
possible selection in the drop-down list 2) Save it as a pdf-report and give
it the same name as the selection in the drop-down list. Save each report on
the desktop.

Automatic calculation is shut off in the workbook. I assume I need to tell
excel to turn it on during this procedure.


Many thanks in advance!

Sverre

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default automate save as of excel-report to pdf-document.

Hi Sverre

I have done something similar on PDF version 5 and it works well. It
assumes you are using a data Validation list for your drop down. It
Loops through the list in cell B5 and prints to pdf. You will need to
adapt this to suit your problem.

Take care

Marcus

Sub ValListLoop()

Dim rng As Range, cell As Range
Dim mycells As String
Dim PDFFileName As String

Set rng = Evaluate(ActiveSheet.Range("B5").Validation.Formul a1)
For Each cell In rng
Application.Calculation = xlAutomatic 'turn calcs on
ActiveSheet.Range("B5").Value = cell.Value 'Change to suit
mycells = Range("B5").Value 'Change to suit
Sheets("Sheet1").Select 'Change to suit
Application.ActivePrinter = "Adobe PDF on Ne01:" 'Change path
Let PDFFileName = "C:\" & mycells & ".pdf" ' change to desktop
path
SendKeys PDFFileName & "{ENTER}", False
ActiveWindow.SelectedSheets.PrintOut copies:=1
SFileName = Chr(34) & PDFFileName & Chr(34)
Next
Application.Calculation = xlManual 'turn calcs off
End Sub

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
Looking for best method to automate monthly Excel report Eric Bragas[_2_] Excel Programming 4 June 12th 07 07:22 PM
Automate Excel report to place certain data into existing report? Craig Harrison Excel Worksheet Functions 3 July 25th 06 01:54 PM
automate entries into document from a excel database Designer Lady New Users to Excel 3 March 23rd 06 09:43 PM
'document not saved' for 'save' or 'save as' an EXCEL file Judy Chuang Excel Discussion (Misc queries) 1 July 11th 05 10:12 PM
Excel 2002 Automate shared workbook at close to save changes to new document tmerrifield Excel Programming 0 October 27th 04 03:45 PM


All times are GMT +1. The time now is 04:03 AM.

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"