Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default FileSearch inconsistencies between Office/Windows version combinat

I have a piece of code developed on Excel 97/Windows 98, which includes:

With Application.FileSearch
.FileName = "*."
.LookIn = cstrLocPath 'Constant containing required path string
.Execute
x = .FoundFiles.Count
End With

to count the number of files with no extension.

The code works fine on the development PC.

Another PC in the same office has Excel 97 running on Windows XP. Using Debug, Compile in the VBA Editor, no compile errors are found. However, when I run the code, I get a runtime error on trying to execute the '.FileName = "*."' line, indicating that some part of this line is invalid. If I substitute a file name in place of the wildcard (*), the problem goes away, indicating that this combination of versions doesn't like the wildcard.

Another PC in that office has Excel 2000 running on Windows XP (sorry, I can't take any responsibility for the mixture of versions on this client's site!) and the error message doesn't come up, although it didn't find any files (I'll have to go back and debug that problem separately).

Does anyone know a workaround for the Excel 97/Windows XP problem with the wildcard in a FileSearch? (I have a feeling I've had a different problem with wildcards on that PC in the past, but just wrote a workaround on that occasion).

Thanks and regards
--
Alison
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default FileSearch inconsistencies between Office/Windows version combinat

I don't have winXP (or xl97), but how about:

.filename = ".*"

If you're trying to limit the files to those that don't have an extension, maybe
you could just check once you retrieve all of them (with or without extensions).

Ali Campbell wrote:

I have a piece of code developed on Excel 97/Windows 98, which includes:

With Application.FileSearch
.FileName = "*."
.LookIn = cstrLocPath 'Constant containing required path string
.Execute
x = .FoundFiles.Count
End With

to count the number of files with no extension.

The code works fine on the development PC.

Another PC in the same office has Excel 97 running on Windows XP. Using Debug, Compile in the VBA Editor, no compile errors are found. However, when I run the code, I get a runtime error on trying to execute the '.FileName = "*."' line, indicating that some part of this line is invalid. If I substitute a file name in place of the wildcard (*), the problem goes away, indicating that this combination of versions doesn't like the wildcard.

Another PC in that office has Excel 2000 running on Windows XP (sorry, I can't take any responsibility for the mixture of versions on this client's site!) and the error message doesn't come up, although it didn't find any files (I'll have to go back and debug that problem separately).

Does anyone know a workaround for the Excel 97/Windows XP problem with the wildcard in a FileSearch? (I have a feeling I've had a different problem with wildcards on that PC in the past, but just wrote a workaround on that occasion).

Thanks and regards
--
Alison


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default FileSearch inconsistencies between Office/Windows version comb

Thanks, Dave -

I'm off to the client's now, so will try this.

Cheers
--
Alison


"Dave Peterson" wrote:

I don't have winXP (or xl97), but how about:

.filename = ".*"

If you're trying to limit the files to those that don't have an extension, maybe
you could just check once you retrieve all of them (with or without extensions).

Ali Campbell wrote:

I have a piece of code developed on Excel 97/Windows 98, which includes:

With Application.FileSearch
.FileName = "*."
.LookIn = cstrLocPath 'Constant containing required path string
.Execute
x = .FoundFiles.Count
End With

to count the number of files with no extension.

The code works fine on the development PC.

Another PC in the same office has Excel 97 running on Windows XP. Using Debug, Compile in the VBA Editor, no compile errors are found. However, when I run the code, I get a runtime error on trying to execute the '.FileName = "*."' line, indicating that some part of this line is invalid. If I substitute a file name in place of the wildcard (*), the problem goes away, indicating that this combination of versions doesn't like the wildcard.

Another PC in that office has Excel 2000 running on Windows XP (sorry, I can't take any responsibility for the mixture of versions on this client's site!) and the error message doesn't come up, although it didn't find any files (I'll have to go back and debug that problem separately).

Does anyone know a workaround for the Excel 97/Windows XP problem with the wildcard in a FileSearch? (I have a feeling I've had a different problem with wildcards on that PC in the past, but just wrote a workaround on that occasion).

Thanks and regards
--
Alison


--

Dave Peterson


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default FileSearch inconsistencies between Office/Windows version comb

Aaargh! When I got back to the client, they'd decided to do the sensible thing and standardise their software, so I found Excel 2002/Windows XP had replaced the Excel 97/Windows XP combination.

The problem had gone away with this new configuration, so I wasn't able to test whether your solution would have fixed it or not!

Thanks again for your help.

Cheers
--
Alison


"Dave Peterson" wrote:

I don't have winXP (or xl97), but how about:

.filename = ".*"

If you're trying to limit the files to those that don't have an extension, maybe
you could just check once you retrieve all of them (with or without extensions).

Ali Campbell wrote:

I have a piece of code developed on Excel 97/Windows 98, which includes:

With Application.FileSearch
.FileName = "*."
.LookIn = cstrLocPath 'Constant containing required path string
.Execute
x = .FoundFiles.Count
End With

to count the number of files with no extension.

The code works fine on the development PC.

Another PC in the same office has Excel 97 running on Windows XP. Using Debug, Compile in the VBA Editor, no compile errors are found. However, when I run the code, I get a runtime error on trying to execute the '.FileName = "*."' line, indicating that some part of this line is invalid. If I substitute a file name in place of the wildcard (*), the problem goes away, indicating that this combination of versions doesn't like the wildcard.

Another PC in that office has Excel 2000 running on Windows XP (sorry, I can't take any responsibility for the mixture of versions on this client's site!) and the error message doesn't come up, although it didn't find any files (I'll have to go back and debug that problem separately).

Does anyone know a workaround for the Excel 97/Windows XP problem with the wildcard in a FileSearch? (I have a feeling I've had a different problem with wildcards on that PC in the past, but just wrote a workaround on that occasion).

Thanks and regards
--
Alison


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default FileSearch inconsistencies between Office/Windows version comb

Just count it as a win and walk, er, run away happy!

Ali Campbell wrote:

Aaargh! When I got back to the client, they'd decided to do the sensible thing and standardise their software, so I found Excel 2002/Windows XP had replaced the Excel 97/Windows XP combination.

The problem had gone away with this new configuration, so I wasn't able to test whether your solution would have fixed it or not!

Thanks again for your help.

Cheers
--
Alison

"Dave Peterson" wrote:

I don't have winXP (or xl97), but how about:

.filename = ".*"

If you're trying to limit the files to those that don't have an extension, maybe
you could just check once you retrieve all of them (with or without extensions).

Ali Campbell wrote:

I have a piece of code developed on Excel 97/Windows 98, which includes:

With Application.FileSearch
.FileName = "*."
.LookIn = cstrLocPath 'Constant containing required path string
.Execute
x = .FoundFiles.Count
End With

to count the number of files with no extension.

The code works fine on the development PC.

Another PC in the same office has Excel 97 running on Windows XP. Using Debug, Compile in the VBA Editor, no compile errors are found. However, when I run the code, I get a runtime error on trying to execute the '.FileName = "*."' line, indicating that some part of this line is invalid. If I substitute a file name in place of the wildcard (*), the problem goes away, indicating that this combination of versions doesn't like the wildcard.

Another PC in that office has Excel 2000 running on Windows XP (sorry, I can't take any responsibility for the mixture of versions on this client's site!) and the error message doesn't come up, although it didn't find any files (I'll have to go back and debug that problem separately).

Does anyone know a workaround for the Excel 97/Windows XP problem with the wildcard in a FileSearch? (I have a feeling I've had a different problem with wildcards on that PC in the past, but just wrote a workaround on that occasion).

Thanks and regards
--
Alison


--

Dave Peterson



--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default FileSearch inconsistencies between Office/Windows version combinat

In my experience, FileSearch is "flaky" -- returns no files when there are
some matches -- with Excel 2002 and WinXP. Don't know about your combination
of versions.

On Wed, 7 Jul 2004 17:27:01 -0700, Ali Campbell
wrote:

Another PC in that office has Excel 2000 running on Windows XP (sorry, I

can't take any responsibility for the mixture of versions on this client's
site!) and the error message doesn't come up, although it didn't find any
files (I'll have to go back and debug that problem separately).

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
Display version of Windows office 2007 Scott Excel Discussion (Misc queries) 1 September 28th 08 02:11 PM
Calculator in Windows like Mac version Julie D Setting up and Configuration of Excel 0 November 8th 06 06:08 PM
Date issue between Windows and Macintosh version dlg1967 Excel Discussion (Misc queries) 4 January 19th 05 03:51 PM
Excel 97 Macros in Later Version of Windows Partho[_2_] Excel Programming 1 June 9th 04 08:51 AM
Office automation application which will work with any version of office C#.NET Silly Programmer Excel Programming 1 February 21st 04 10:54 AM


All times are GMT +1. The time now is 06:56 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"