ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   URGENT!! PLEASE I NEED to finish this by 530 CT (https://www.excelbanter.com/excel-programming/317312-urgent-please-i-need-finish-530-ct.html)

VBA-Beginner

URGENT!! PLEASE I NEED to finish this by 530 CT
 
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

Bob Phillips[_6_]

URGENT!! PLEASE I NEED to finish this by 530 CT
 
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)


"VBA-Beginner" wrote in message
...
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





All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com