Search entire computer before opening file

P

pswanie

hi..

i got this to open a workbook. in it i tell it where to look for the
workbook. i would however like it to go and look on the entire system for
it...(including removeble drives etc..) i use it on about 14 branches and the
users (for out of stupidity?) go and move my file.....!!! thanx

The file from what the macro run is called inventry.xls

the two should be in the folder inventry. but from time to time they move
the inventry.xls to for example the desktop.

(if it can.... first look in outlook if there is a email with a attachment
with the name ghostINVENTRY.xls and then the entire system)

Phillip

************************************************************

Workbooks.Open Filename:= _
"C:\maykent\inventry\ghostinventry.xls"
************************************************************
 
J

Jim Thomlinson

While that is possible it may not be what you really want to do... A full
scan of your computer could take a VERY long time. Additionally if you have
copies fo the at file archived it is going to find those. How about if it
does not find the file you are looking for it opens the File Open dialog???

dim wbkFound as workbook

on error resume next
set wbkFound = Workbooks("Inventry.xls")
If wbkFound is nothing then
set wbkFound Workbooks.Open Filename:= _
"C:\maykent\inventry\ghostinventry.xls"
end if
If wbkFound is nothing then
Application.Dialogs(xlDialogOpen).Show
end if
 
P

pswanie

it only needs to look in for example the following locations
outlook
c:\maykent
desktop

(in that order) i ocasionaly email the new/updated workbook called
ghostINVENTRY.xls

i will give that a shot in the morning


will let u know.
 

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