我需要在电子邮件中发送一系列单元格,但格式化为pdf文件。现在我能够创建pdf并保存它,但由于excel文件将在不同的计算机中使用,我现在无法通过文件的路径并以这种方式附加它。是否可以立即将该范围作为pdf附加到电子邮件中?或者提示窗口以便用户选择保存pdf的位置,然后我可以使用该路径将其附加到电子邮件中。 THKS!
答案 0 :(得分:0)
Application.Workbook().Path
可以满足您的需求:
Dim FolderPath As String
FolderPath = Application.Workbook("name of book.xlsm").Path
'Use your save PDF macro to save to the FolderPath string
'Reference FolderPath in attachment to message.