Hey all, after coming up with some macro's, and obeying company policy, I had to password protect the code behind all the code, requiring me to go to each individual desktop when installing to edit 2 simple lines of code. As this is rather tedious and time consuming, I tried to come up with a solution.
Each macro has to have an employee's id # and username, the id consisting of 3 characters / digits (ex: XX8) and the username, being the first letter of their first name, and their last name, (ex: J.Smith).
Within the code, I had simply declared it as :
eid = ("XX8")
username = ("J.Smith")
And simply doing the Sendkeys when I needed it. Rather than have to go around to over 400 desktops as updates are needed for the heart of the code, I started using the Shell Function to call up two .txt files. Like this :
EID = Shell("notepad.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\eid.txt", 1)
Pause .6
Sendkeys "^a"
Sendkeys "^c"
Sendkeys "%{F4}"
&
USERNAME = Shell("notepad.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\username.txt", 1)
Pause .6
Sendkeys "^a"
Sendkeys "^c"
Sendkeys "%{F4}"
Instead of getting the info from a outside source from a copy / paste method from notepad, I'm trying to have a standalone macro that has the employee ID and username, to which I can call upon, and use those variables in the running macro.
Now, in the macro the user runs, I've included this line :
TEST = Shell("C:\Program Files\Attachmate\E!E2K\ebrun.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\INFO.ebm", 7)
With the INFO.ebm containing the eid and username declarations, I put the above line in pw macro, have a msgbox pop up to test, and I'm not getting the strings. If I put a msgbox in the unprotected macro and run it from the pw macro, the strings work.
Any ideas, or would what I'm after even work?
Each macro has to have an employee's id # and username, the id consisting of 3 characters / digits (ex: XX8) and the username, being the first letter of their first name, and their last name, (ex: J.Smith).
Within the code, I had simply declared it as :
eid = ("XX8")
username = ("J.Smith")
And simply doing the Sendkeys when I needed it. Rather than have to go around to over 400 desktops as updates are needed for the heart of the code, I started using the Shell Function to call up two .txt files. Like this :
EID = Shell("notepad.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\eid.txt", 1)
Pause .6
Sendkeys "^a"
Sendkeys "^c"
Sendkeys "%{F4}"
&
USERNAME = Shell("notepad.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\username.txt", 1)
Pause .6
Sendkeys "^a"
Sendkeys "^c"
Sendkeys "%{F4}"
Instead of getting the info from a outside source from a copy / paste method from notepad, I'm trying to have a standalone macro that has the employee ID and username, to which I can call upon, and use those variables in the running macro.
Now, in the macro the user runs, I've included this line :
TEST = Shell("C:\Program Files\Attachmate\E!E2K\ebrun.exe C:\Program Files\Attachmate\E!E2K\Macros\ENU\INFO.ebm", 7)
With the INFO.ebm containing the eid and username declarations, I put the above line in pw macro, have a msgbox pop up to test, and I'm not getting the strings. If I put a msgbox in the unprotected macro and run it from the pw macro, the strings work.
Any ideas, or would what I'm after even work?