Jump to content
Macro Express Forums

Recommended Posts

Hi All, 

Hoping someone can help with this ongoing headscratcher I am dealing with. 

Currently I have a shared macro for business data that saves and appends all data to an Excel CSV file. People can use the macro on their own profiles and it will still save their data to our shared CSV. 

We are losing our shared drive and being moved to Google Drive, so this is where the problem comes in. I use Variable Modify String: Append > Variable Modify String: Append to Text File. Filename is the path to the CSV in our Group drive.

We have all synced our Google Drive to our profiles so I am amble to create a file path that is similar, however this part is different for each user, and looks like so: C:\Users\USERNAME\Google Drive\Folder A\Folder B\Shared Excel Data File.csv 

The username is obviously different for each person, so one might say: 

C:\Users\Bill\Google Drive\Folder A\Folder B\Shared Excel Data File.csv 

C:\Users\Adam\Google Drive\Folder A\Folder B\Shared Excel Data File.csv 

Is there a way to apply the environment variable automatically so that we can still make global changes without having colleagues import a new macro with each update? For example, can I have a constant environment variable like USERPROFILE, which is C:\Users\USERNAME\ on our systems? Then have it somehow combined with the remaining path Google Drive\Folder A\Folder B\Shared Excel Data File.csv ? 

Sorry, that was long-winded, and hopefully it makes sense, but any help is greatly appreciated! Thank you!

Share this post


Link to post
Share on other sites

Something like this may work:

Set Variable %T1% to "Path to My Documents"
Replace "\Documents" with "\Google Drive\Folder A\Folder B\Shared Excel Data File.csv" in %T1%

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×