在 Excel 中创建按钮来复制文件?

发布于 2024-12-06 22:16:32 字数 113 浏览 3 评论 0原文

我想在 Excel 2010 中创建一个按钮,单击该按钮时,它将保存当前打开的 Excel 文件并将其复制到 C:\temp。

这可能吗?也许宏应该触发 exe 程序,或者可以在宏内完成所有操作?

I want to create a button in Excel 2010 that when clicked, it will save the currently opened Excel file and copy it to C:\temp.

Is this possible? Perhaps a macro should trigger an exe program, or can be all done within the macro?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

回眸一遍 2024-12-13 22:16:32
With ActiveWorkbook
  .Save
  .SaveCopyAs "C:\Temp\Copy.xls"
End With
With ActiveWorkbook
  .Save
  .SaveCopyAs "C:\Temp\Copy.xls"
End With
好多鱼好多余 2024-12-13 22:16:32

在按钮的 Click 事件中,您可以将当前工作表复制到另一个工作簿中,然后将其保存在 C:\Temp... 类似:

Sheets(Array("Sheet1", "Sheet2", "Another Sheet")).Copy
ActiveWorkbook.SaveAs "C:\Temp\Copy.xls"
ActiveWorkbook.Close

In your button's Click event, you can copy the current worksheets into another workbook and then save that in C:\Temp... Something like:

Sheets(Array("Sheet1", "Sheet2", "Another Sheet")).Copy
ActiveWorkbook.SaveAs "C:\Temp\Copy.xls"
ActiveWorkbook.Close
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文