![]() |
How to execute macro based on a users computer settings
Hello experts,
I'd like to find a method/script to only execute an excel macro based on a users existing file listing on their computer ( or it could be a pre-existing setting; ie. their IP or MAC address). Ideally I'd like to have a macro check for the existence of a certain file (or password phrase encoded in the file) on the directory of a users computer, if YES then execute macro, ELSE don't do anything. This is all done in the background right before the event that usually triggers the primary macro, which is an ftp command line script. My guess is creating a batch file that executes in a windows shell and outputs a value that could be read, but I'm not sure if that's the best way to achieve what I want. I want to avoid using a pop-up form and password inside the excel file - this is currently what I already have. Thank you for your help, -Doug Jr. |
How to execute macro based on a users computer settings
Seems to me your "ideal" solution is pretty easy. You've never worked with
the FileSystemObject? Use CreateObject("Scripting.FileSystemObject") to create an object which you can subsequently use to check for the existance of a path or file and, if you choose, to read the contents of a file. Full documentation on the FileSystemObject is in the CHM for both VB and VBS. I can send you a copy if you don't already have one yourself - though you probably do, hidden away somewhere. --- "Daddy Mac will make ya JUMP JUMP" wrote: I'd like to find a method/script to only execute an excel macro based on a users existing file listing on their computer ( or it could be a pre-existing setting; ie. their IP or MAC address). Ideally I'd like to have a macro check for the existence of a certain file (or password phrase encoded in the file) on the directory of a users computer, if YES then execute macro, ELSE don't do anything. This is all done in the background right before the event that usually triggers the primary macro, which is an ftp command line script. My guess is creating a batch file that executes in a windows shell and outputs a value that could be read, but I'm not sure if that's the best way to achieve what I want. I want to avoid using a pop-up form and password inside the excel file - this is currently what I already have. |
How to execute macro based on a users computer settings
Also try this link:
http://groups.google.com/group/micro...5f86 59626ff9 -- urkec "Daddy Mac will make ya JUMP JUMP" wrote: Hello experts, I'd like to find a method/script to only execute an excel macro based on a users existing file listing on their computer ( or it could be a pre-existing setting; ie. their IP or MAC address). Ideally I'd like to have a macro check for the existence of a certain file (or password phrase encoded in the file) on the directory of a users computer, if YES then execute macro, ELSE don't do anything. This is all done in the background right before the event that usually triggers the primary macro, which is an ftp command line script. My guess is creating a batch file that executes in a windows shell and outputs a value that could be read, but I'm not sure if that's the best way to achieve what I want. I want to avoid using a pop-up form and password inside the excel file - this is currently what I already have. Thank you for your help, -Doug Jr. |
How to execute macro based on a users computer settings
Here's a link of the sort I was looking for (or rather "talking about" - I
didn't bother to look for it) last night. This lists a number of functions that enable VBScript to get data about the machine it's running on: http://msdn.microsoft.com/en-us/libr...53(VS.85).aspx If you explore around a little you'll probably also find, in nearby links on their tree, more information of the same sort. --- "Daddy Mac will make ya JUMP JUMP" wrote: I'd like to find a method/script to only execute an excel macro based on a users existing file listing on their computer ( or it could be a pre-existing setting; ie. their IP or MAC address). Ideally I'd like to have a macro check for the existence of a certain file (or password phrase encoded in the file) on the directory of a users computer, if YES then execute macro, ELSE don't do anything. This is all done in the background right before the event that usually triggers the primary macro, which is an ftp command line script. My guess is creating a batch file that executes in a windows shell and outputs a value that could be read, but I'm not sure if that's the best way to achieve what I want. I want to avoid using a pop-up form and password inside the excel file - this is currently what I already have. |
All times are GMT +1. The time now is 09:42 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com