Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Multiple file extensions causing issues

Our org converted to XL2007 and we have a LOT of legacy programs out there
that use/populate/manipulate multiple files.

In the past, there was only one working file extension, XLS. Now, with our
legacy files, there could be three: XLS, XLSX, XLSM (I know there are several
other types, but these are the primary three that we would be using).

Now, since there are several different file extensions, many of our programs
will misfire when looking for target files. Anyone have any suggestions on
how to deal with this neatly in code? I'd hate to have to set up an
"If...Then..." everytime to try each file extension...any ideas?

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Multiple file extensions causing issues

"*.xl*" should cover all..

If this post helps click Yes
---------------
Jacob Skaria


"xp" wrote:

Our org converted to XL2007 and we have a LOT of legacy programs out there
that use/populate/manipulate multiple files.

In the past, there was only one working file extension, XLS. Now, with our
legacy files, there could be three: XLS, XLSX, XLSM (I know there are several
other types, but these are the primary three that we would be using).

Now, since there are several different file extensions, many of our programs
will misfire when looking for target files. Anyone have any suggestions on
how to deal with this neatly in code? I'd hate to have to set up an
"If...Then..." everytime to try each file extension...any ideas?

Thanks in advance for your help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Multiple file extensions causing issues

I prefer Jacob's solution, but here is an alternative just as an FYI; it
checks the file type instead of the file extension. You could also rework
this into a case statement instead of an extended OR statement.

'snippet based on fil.type
For Each fil In fld.Files
If fil.Type = "Microsoft Office Excel 2007 Workbook" Or _
fil.Type = "Microsoft Excel Worksheet" Or _
fil.Type = "Microsoft Office Excel Macro-Enabled Worksheet" Or _
fil.Type = "Microsoft Office Excel 2007 Macro-Enabled Workbook"
Or _
fil.Type = "Microsoft Office Excel 97-2003 Worksheet" Then
ListFilesPriv = ListFilesPriv & ";" & fil.Path
End If
Next


"xp" wrote:

Our org converted to XL2007 and we have a LOT of legacy programs out there
that use/populate/manipulate multiple files.

In the past, there was only one working file extension, XLS. Now, with our
legacy files, there could be three: XLS, XLSX, XLSM (I know there are several
other types, but these are the primary three that we would be using).

Now, since there are several different file extensions, many of our programs
will misfire when looking for target files. Anyone have any suggestions on
how to deal with this neatly in code? I'd hate to have to set up an
"If...Then..." everytime to try each file extension...any ideas?

Thanks in advance for your help.

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
Phantom Objects causing issues peterpeter Excel Discussion (Misc queries) 4 December 3rd 07 12:54 PM
$ dollar signs causing issues in Excel VBA - HTML [email protected] Excel Programming 2 September 2nd 07 04:55 AM
xls spreadsheet constantly calculating causing navigation issues Matabi Excel Worksheet Functions 1 March 15th 06 12:10 PM
If then statement causing value issues in Macros ssciarrino Excel Programming 2 November 29th 05 06:06 PM
excel 2000 add-in causing delay issues jamesd3rd Excel Programming 0 May 11th 04 09:22 PM


All times are GMT +1. The time now is 10:11 PM.

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

About Us

"It's about Microsoft Excel"