VBA:如何将Excel Workbook保存到桌面,无论用户如何? [英] VBA: How to save Excel Workbook to Desktop regardless of user?
问题描述
最初的一切都将在共享的网络文件夹,但现在我有大约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屋!