{"id":604,"date":"2021-09-03T20:02:47","date_gmt":"2021-09-03T20:02:47","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/office-macro-to-save-file-as-pdf-based-on-cell-conte-11246-html"},"modified":"2021-09-27T19:38:27","modified_gmt":"2021-09-27T19:38:27","slug":"office-macro-to-save-file-as-pdf-based-on-cell-conte-11246-html","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/office\/macro-to-save-file-as-pdf-based-on-cell-conte\/11246.html","title":{"rendered":"Macro to Save File as PDF based on Cell Conte"},"content":{"rendered":"<p><td>I am looking for a macro that when I click on a button, the workbook is saved as a PDF file and automatically named based on cell content. Excel 2007<\/p>\n<p>Sub pdfsave()<\/p>\n<p>pdfname = Range(&#8220;A1&#8221;).Value<\/p>\n<p>ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=pdfname, Quality:=xlQualityStandard, _<br \/>IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _<br \/>True<br \/>End Sub<\/p>\n<p>This works, but I want to save it straight to a specific folder on my computer. for example c:my documents\/PDF.<br \/>Also, do you you if it is possible to save the document as a PDF and at the same time as an excel file in the same macro?<\/p>\n<\/td>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"inline_featured_image":false,"iawp_total_views":99},"question-category":[],"question_tags":[],"class_list":["post-604","question","type-question","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=604"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=604"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=604"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}