• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Marco To start on open for specfic user

Gman87

New Member
Hello All,

I work in manufacturing environment and have a computer set up on the floor for operators to fill in data, this spreadsheet can then be viewed as read only over our network.
I have a macro to save the file and refresh pivot charts every 15 mins so we can always view a current version of the file. My problem is sometimes the excel file gets closed on the manufacturing computer and the macro will not start it self (I don't have it start on open currently so viewers do not accidentally begin to overwrite or save duplicates) I then have to go manually start the macro

What I think would work out great is a macro to start on open for a specific user/computer

The computer/User is "DataCollector"
the macro is "SaveRefresh"

I am far from a super user in but i have picked up a lot of tips a tricks in the forums here!

Thank you,
 
For getting environment variable use Environ() function

For example something like below.
Code:
Dim uName As String

uName = Environ("username")

If uName = "DataCollector" Then
    "Your Operation Here"
End If
 
Back
Top