How to execute macro based on a users computer settings

  • Thread starter Daddy Mac will make ya JUMP JUMP
  • Start date
D

Daddy Mac will make ya JUMP JUMP

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.
 
B

Bob Bridges

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.
 
B

Bob Bridges

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/library/ms724953(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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top