By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,761 Members | 1,879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,761 IT Pros & Developers. It's quick & easy.

From Access Export Excel to Desktop

P: 11
I have a database that has been split. The tables are in a network shared folder and the front end forms & queries are in a file saved in a SharePoint Folder. Everyone is able to save and update the data in the db but I am not able to get any of the excel files to save to each person desktop. Was using a button that ran a macro using the "RunSaveImportExport" command (C:\Users\environ("username")\Desktop\Proj_in_Red_ Export.xlsx"). Thank for all for your help. David
Feb 26 '18 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 3,283

First, I would recommend doing what you are doing in VBA, as it will allow you to use variables more easily.

What you are looking for is to set up a variable in VBA to store the Username:

Expand|Select|Wrap|Line Numbers
  1. strUserName = Environ("username")
Then the Export string becomes:

Expand|Select|Wrap|Line Numbers
  1. strExport = "C:\Users\" & strUserName & "\Desktop\Proj_in_Red_ Export.xlsx"
This is a basic outline and not the complete code, but htis should point you in the right direction.

Please let us know if you have any additional questions we can work through with this.
Feb 26 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.