URGENT!! PLEASE I NEED to finish this by 530 CT

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to use a file exists statement to determine whether a command button
is visible or not on a spread sheet.

This is what I have come up with so far, but I am not sure of it or how it
actually works...

Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.FileExists("C:\Program Files\Hummingbird\DM
Extensions\Interceptor.exe")
Sheets("TIMESHEET").CMDBTN.Visible = a
 
I don't think it does work as shown. Fileexists returns true or false, so
you should not be trying to create an object variable, just a standard
boolean

a = fs.FileExists("C:\Program
Files\Hummingbird\DMExtensions\Interceptor.exe")

You can also do it directly like so

Sheets("TIMESHEET").CMDBTN.Visible = fs.FileExists("C:\Program Files\" & _
"Hummingbird\DMExtensions\Interceptor.exe")

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top