无论用户如何,如何将Excel Workbook保存到桌面? [英] How to save Excel Workbook to Desktop regardless of user?
问题描述
我有一个Excel工作簿,在表单"按钮上单击,我需要将工作簿的副本保存到用户的桌面.
I have an Excel Workbook that on Form Button click I need to save a copy of the workbook to the user's Desktop.
最初,所有内容都将位于共享的Network文件夹中,但是现在我有大约6个不同的用户,当他们单击按钮时,我需要将工作簿保存到各自的桌面.
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.
他们是否可以(无需编码)将其保存到计算机桌面上而无需指定单个用户(这需要我维护6个不同的Workbook文件)?
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")
这篇关于无论用户如何,如何将Excel Workbook保存到桌面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!