Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Phantom Objects causing issues | Excel Discussion (Misc queries) | |||
$ dollar signs causing issues in Excel VBA - HTML | Excel Programming | |||
xls spreadsheet constantly calculating causing navigation issues | Excel Worksheet Functions | |||
If then statement causing value issues in Macros | Excel Programming | |||
excel 2000 add-in causing delay issues | Excel Programming |