Question:
Why does my PDF writer save files to "My Documents", using a macro in Excel?
alex_18ca
2006-08-31 11:10:58 UTC
I am using Adobe PDF writer (I believe) to create PDF files of a spreadsheet in Excel. I want them to save in the Rates folder, but they always get created in My Documents. Can someone tell me why? The code I am using is as follows:

Workbooks.Open Filename:="L:\RATES\External.xls"
Sheets("Cash").Select
Application.ActivePrinter = "Acrobat PDFWriter on LPT1:"
ChDir "L:\rates\"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="Acrobat PDFWriter on LPT1:", prtofilename:="L:\rates\cash"
Kill "L:\rates\cash"



So it should be saving the pdf file as cash.pdf in the L:\Rates folder, but instead it always defaults to My Documents. Any help would be greatly appreciated!

Thanks.
Three answers:
anonymous
2006-09-04 02:03:01 UTC
It is obviouse, the path for the file name must contain the extension (Last three characters after the Dot) the file name should be Cash.pdf not just Cash

And then the path should be

"L:\rates\cash.pdf" not just "L:\rates\cash"



The Printer see that the folder is not found, so the folder is back to the default one "My Documents"



good luck



Read my profile, I am XLMan
?
2016-11-06 08:57:55 UTC
A macro is a job or set of projects used regularly. utilising a macro to replace a report is a reasonably basic operation. strategies, Macro, checklist new, supply the macro a recognition and assign a shortcut key. The field then minimises to purely teach the macro toolbar. The macro archives the keys pressed, interior the series they're pressed and is composed of any mouse clicks and the place they're. A macro additionally demands actual enter from you because of the fact the macro won't in basic terms run by ability of itself. If the spreadsheet you're engaged on references the information in the different report, then once you open the spreadsheet, you will possibly desire to be asked regardless of in case you want to replace the information or no longer. in case you opt to replace, then in basic terms click specific (replace). this may not require using a macro in any respect.
anonymous
2006-09-01 17:40:35 UTC
Go to file ----> save as -------> and selected them to go to a specific place.. If you dont they will default to my documents.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...