Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default A double check, please

Generally speaking that will work for you. The only areas that I wonder about
is did you mean Application.path or thisworkbook.path? Application.path is
the directory where the Excel.exe file is stored and normally you do not save
a lot of stuff in there... (not necessarily wrong, just curious). The other
comment is that you do not need to do that as an if - then - else. It could
be written

If Len(Dir(Application.Path & "\" & "abc.exe")) = 0 Then Exit Sub

etc

HTH


"Stuart" wrote:

If I say:
If Len(Dir(Application.Path & "\" & "abc.exe")) _
= 0 Then
Exit Sub
Else
etc
End If

Can I reliably assume that Exit Sub will only occur if the file 'abc.exe' is
not found in the Office-installed path?
....not a trick question, just wish to know what I can be sure of, if I make
the statement.

Regards.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default A double check, please

Many thanks.
I'm trying to check the file exists... so
If abc.exe exists 'ok
Else MsgBox "You need to install abc.exe"
Exit Sub
End If
was my logic.

There are actually 2 files I'm looking for. I believe both are Optional
rather than Default choices during an Office install. I believe both files
(if installed during the initial Office install .... or later, via
Add/Remove Features) will
reside in Application.Path. However there may well be Office version issues
to deal with.

What do you think, please?

Regards.

"Jim Thomlinson" wrote in message
...
Generally speaking that will work for you. The only areas that I wonder
about
is did you mean Application.path or thisworkbook.path? Application.path is
the directory where the Excel.exe file is stored and normally you do not
save
a lot of stuff in there... (not necessarily wrong, just curious). The
other
comment is that you do not need to do that as an if - then - else. It
could
be written

If Len(Dir(Application.Path & "\" & "abc.exe")) = 0 Then Exit Sub

etc

HTH


"Stuart" wrote:

If I say:
If Len(Dir(Application.Path & "\" & "abc.exe")) _
= 0 Then
Exit Sub
Else
etc
End If

Can I reliably assume that Exit Sub will only occur if the file 'abc.exe'
is
not found in the Office-installed path?
....not a trick question, just wish to know what I can be sure of, if I
make
the statement.

Regards.






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default A double check, please

That logic looks good. If you are looking for two files why not something like

If len(dir(ABC.exe)) < 0 and len(dir(CDE.exe)) < 0 then
'both files exist
'Do whatever you want to do
elseif len(dir(ABC.exe)) = 0
msgbox "ABC.exe does not exist"
else
msgbox "CDE.exe does not exist"
endif

Gets rid of that sometimes pesky exit sub... As for the files existing in
the application directory that sounds entirely resonable to me.

HTH

"Stuart" wrote:

Many thanks.
I'm trying to check the file exists... so
If abc.exe exists 'ok
Else MsgBox "You need to install abc.exe"
Exit Sub
End If
was my logic.

There are actually 2 files I'm looking for. I believe both are Optional
rather than Default choices during an Office install. I believe both files
(if installed during the initial Office install .... or later, via
Add/Remove Features) will
reside in Application.Path. However there may well be Office version issues
to deal with.

What do you think, please?

Regards.

"Jim Thomlinson" wrote in message
...
Generally speaking that will work for you. The only areas that I wonder
about
is did you mean Application.path or thisworkbook.path? Application.path is
the directory where the Excel.exe file is stored and normally you do not
save
a lot of stuff in there... (not necessarily wrong, just curious). The
other
comment is that you do not need to do that as an if - then - else. It
could
be written

If Len(Dir(Application.Path & "\" & "abc.exe")) = 0 Then Exit Sub

etc

HTH


"Stuart" wrote:

If I say:
If Len(Dir(Application.Path & "\" & "abc.exe")) _
= 0 Then
Exit Sub
Else
etc
End If

Can I reliably assume that Exit Sub will only occur if the file 'abc.exe'
is
not found in the Office-installed path?
....not a trick question, just wish to know what I can be sure of, if I
make
the statement.

Regards.







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default A double check, please

Thanks again.
I actually had:
If Len(Dir(Application.Path & "\" & "makecert.exe")) _
= 0 _
Or Len(Dir(Application.Path & "\" & "signer.dll")) _
= 0 Then
MsgBox "etc"
Exit sub
Else
etc
end If

BTW a very big help: where can I download 'signer.dll'?
I'm trying to develop a wrapper by which I can create
Self Certificates.....cannot find this file anywhere (thought it was with
SDK).

Regards and thanks again.

"Jim Thomlinson" wrote in message
...
That logic looks good. If you are looking for two files why not something
like

If len(dir(ABC.exe)) < 0 and len(dir(CDE.exe)) < 0 then
'both files exist
'Do whatever you want to do
elseif len(dir(ABC.exe)) = 0
msgbox "ABC.exe does not exist"
else
msgbox "CDE.exe does not exist"
endif

Gets rid of that sometimes pesky exit sub... As for the files existing in
the application directory that sounds entirely resonable to me.

HTH

"Stuart" wrote:

Many thanks.
I'm trying to check the file exists... so
If abc.exe exists 'ok
Else MsgBox "You need to install abc.exe"
Exit Sub
End If
was my logic.

There are actually 2 files I'm looking for. I believe both are Optional
rather than Default choices during an Office install. I believe both
files
(if installed during the initial Office install .... or later, via
Add/Remove Features) will
reside in Application.Path. However there may well be Office version
issues
to deal with.

What do you think, please?

Regards.

"Jim Thomlinson" wrote in
message
...
Generally speaking that will work for you. The only areas that I wonder
about
is did you mean Application.path or thisworkbook.path? Application.path
is
the directory where the Excel.exe file is stored and normally you do
not
save
a lot of stuff in there... (not necessarily wrong, just curious). The
other
comment is that you do not need to do that as an if - then - else. It
could
be written

If Len(Dir(Application.Path & "\" & "abc.exe")) = 0 Then Exit Sub

etc

HTH


"Stuart" wrote:

If I say:
If Len(Dir(Application.Path & "\" & "abc.exe")) _
= 0 Then
Exit Sub
Else
etc
End If

Can I reliably assume that Exit Sub will only occur if the file
'abc.exe'
is
not found in the Office-installed path?
....not a trick question, just wish to know what I can be sure of, if
I
make
the statement.

Regards.









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I double check that there are no formulas 2468NICKIL Excel Worksheet Functions 2 April 27th 10 12:49 PM
Is there a template to double check Lottery scratcher tickets? lkn4bearbud Excel Discussion (Misc queries) 1 April 18th 09 08:08 AM
check if there is any double information Art Excel Discussion (Misc queries) 0 December 12th 06 05:52 PM
check for double information Art Excel Worksheet Functions 2 December 11th 06 03:01 PM
Check for double entries in a row Pierrot Robert Excel Worksheet Functions 1 September 5th 05 06:37 PM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"