excel - Excel Mac 宏
问题描述
新手只是想让 Excel (Mac) 将工作表另存为 PDF,这也将文件名另存为单元格名称。我已经让它在我的 Windows Excel 中工作,但在 Mac 中出现运行时错误。请帮忙。
Sub CommandButton1_Click()
pdfName = ActiveSheet.Range("G5") 'PDF name
ChDir ActiveWorkbook.Path & ":" 'Use the files directory
FileSaveName = ActiveSheet.Range("G5") 'Name the PDF file
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
FileSaveName, Quality:=xlQualityStandard, IncludeDocProperties:=True, OpenAfterPublish:=False
MsgBox "File Saved as " & " " & FileSaveName
End Sub
解决方案
推荐阅读
- ruby-on-rails - 如何将 JSON 数据的值保存到 Rails 中的 db?
- python - 为 csv 文件中的每一行生成新的输出
- javascript - Firefox:基于起始 URL 的锚点和焦点输入字段
- javascript - 显示每个项目的关闭按钮并使用 JavaScript 隐藏当前项目
- ios - Using a Notification Extension causes issue with Cocoapods
- amazon-web-services - 限制登录到 AWS 联合身份池的企业 Google 域
- javascript - 包含来自另一个网站的 html 文件?
- nginx - Swagger Nginx 烧瓶-restplus
- javascript - 当用户再次上传图像时,图像的 src 不会改变(socket.io)
- c# - 如何覆盖 TreeNodeCollection.Add(TreeNode)?