Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Pointing search function to "This Drive"?

I burn a set of files - an Excel workbook and several Word documents - to a
CD. All the files are in the same folder. I have hyperlinks in the
workbook to the Word docs that work fine, no matter what the CD drive letter
of the individual computer is.

But I also have a search function that returns the names of documents
matching the search criteria. It works fine on my computer, and fine on a
network drive. But I'm having trouble telling the function to look at "this
folder" on whatever drive it happens to be on. If anyone has suggestions, I
would appreciate it. The relevant parts of the code a

Dim strLocation As String
strLocation = "This Folder"

strName = Range("D3").Text

With Application.FileSearch
.NewSearch
.LookIn = strLocation
.SearchSubFolders = False
.TextOrProperty = strSearchFor
.Filename = "L5-" & strName & "*.doc"
.Execute

TIA
Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pointing search function to "This Drive"?

It isn't clear what "this folder" is supposed to refer to. If it is the
folder where the file with the code resides, then use

strLocation = Thisworkbook.Path

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I burn a set of files - an Excel workbook and several Word documents - to

a
CD. All the files are in the same folder. I have hyperlinks in the
workbook to the Word docs that work fine, no matter what the CD drive

letter
of the individual computer is.

But I also have a search function that returns the names of documents
matching the search criteria. It works fine on my computer, and fine on a
network drive. But I'm having trouble telling the function to look at

"this
folder" on whatever drive it happens to be on. If anyone has suggestions,

I
would appreciate it. The relevant parts of the code a

Dim strLocation As String
strLocation = "This Folder"

strName = Range("D3").Text

With Application.FileSearch
.NewSearch
.LookIn = strLocation
.SearchSubFolders = False
.TextOrProperty = strSearchFor
.Filename = "L5-" & strName & "*.doc"
.Execute

TIA
Ed




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Pointing search function to "This Drive"?

That was it, Tom. Thank you once again.

Ed

"Tom Ogilvy" wrote in message
...
It isn't clear what "this folder" is supposed to refer to. If it is the
folder where the file with the code resides, then use

strLocation = Thisworkbook.Path

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I burn a set of files - an Excel workbook and several Word documents -

to
a
CD. All the files are in the same folder. I have hyperlinks in the
workbook to the Word docs that work fine, no matter what the CD drive

letter
of the individual computer is.

But I also have a search function that returns the names of documents
matching the search criteria. It works fine on my computer, and fine on

a
network drive. But I'm having trouble telling the function to look at

"this
folder" on whatever drive it happens to be on. If anyone has

suggestions,
I
would appreciate it. The relevant parts of the code a

Dim strLocation As String
strLocation = "This Folder"

strName = Range("D3").Text

With Application.FileSearch
.NewSearch
.LookIn = strLocation
.SearchSubFolders = False
.TextOrProperty = strSearchFor
.Filename = "L5-" & strName & "*.doc"
.Execute

TIA
Ed






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
search for text "beginning with" "containing" wildcards David H Excel Worksheet Functions 1 January 13th 10 01:24 PM
=IF(ISNUMBER(SEARCH("ELB",B2)),"Pipe") add more like "ELB" "FLG" MAHMOUD Excel Worksheet Functions 5 September 6th 09 06:04 PM
=IF(ISERROR(SEARCH("insurance",A125,1)),"","*") cynichromantique Excel Worksheet Functions 9 September 25th 08 09:49 PM
Creating a search and "jump to" function Brisebear Excel Discussion (Misc queries) 3 August 21st 06 02:07 AM
Dos not work correct "Search" function LInc New Users to Excel 2 July 20th 06 12:49 PM


All times are GMT +1. The time now is 12:22 PM.

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"