VBA:如何将Excel Workbook保存到桌面,无论用户如何? [英] VBA: How to save Excel Workbook to Desktop regardless of user?

查看:2126
本文介绍了VBA:如何将Excel Workbook保存到桌面,无论用户如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel工作簿,在表单按钮点击我需要将工作簿的副本保存到用户的桌面。



最初的一切都将在共享的网络文件夹,但现在我有大约6个不同的用户,当他们点击按钮,我需要将工作簿保存到他们个人的桌面。



是他们的方式编码方式)保存到机器桌面而不必指定个别用户(这将需要我维护6个不同的工作簿文件)?

解决方案

我认为这是获取桌面路径的最可靠的方法,并不总是与用户名相同。

  MsgBox CreateObject(WScript.Shell)。specialfolders(Desktop)


I have an Excel Workbook that on Form Button click I need to save a copy of the workbook to the user's Desktop.

Originally everything was going to be on a shared Network folder, but now I have about 6 different users that when they click the button, I need to save the workbook to their individual Desktops.

Is their a way (coding-wise) to save to the machine Desktop without having to specify individual users (which would require me to maintain 6 different Workbook files)?

解决方案

I think this is the most reliable way to get the desktop path which isn't always the same as the username.

MsgBox CreateObject("WScript.Shell").specialfolders("Desktop")

这篇关于VBA:如何将Excel Workbook保存到桌面,无论用户如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆