Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Retrieving Excel File extension based on XL File Format Enumeratio


Hi,
Am actually trying to find the extension of a file with the XL File Format
Enumeration as the input. For example, the XL File Format Enumeration for
".csv" file is 6, so if I give the input as 6, the output should be ".csv".

Is there a way to do this?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Retrieving Excel File extension based on XL File Format Enumeratio


AFAIK there is no direct way to return the default file extensions
associated with a given file format.

Typically you won't be working with many of them so why not hard code them
against a lookup table, or even simply

Select Case myFileFormat
case xlCSV: sExt = ".csv"
case xlWorkbookNormal, 56: sExt = ".xls"
case 51: sExt = ".xlsx"
' etc
end Select

Regards,
Peter T

"Sasikumar Kannappan" wrote
in message ...
Hi,
Am actually trying to find the extension of a file with the XL File Format
Enumeration as the input. For example, the XL File Format Enumeration for
".csv" file is 6, so if I give the input as 6, the output should be
".csv".

Is there a way to do this?

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Retrieving Excel File extension based on XL File Format Enumer


Thanks for the response Peter. That's the solution am using right now, wanted
to check if there's anything else available :)

"Peter T" wrote:

AFAIK there is no direct way to return the default file extensions
associated with a given file format.

Typically you won't be working with many of them so why not hard code them
against a lookup table, or even simply

Select Case myFileFormat
case xlCSV: sExt = ".csv"
case xlWorkbookNormal, 56: sExt = ".xls"
case 51: sExt = ".xlsx"
' etc
end Select

Regards,
Peter T

"Sasikumar Kannappan" wrote
in message ...
Hi,
Am actually trying to find the extension of a file with the XL File Format
Enumeration as the input. For example, the XL File Format Enumeration for
".csv" file is 6, so if I give the input as 6, the output should be
".csv".

Is there a way to do this?

Thanks in advance.




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
Determine Excel file version with no file extension. tjlumpkin Excel Discussion (Misc queries) 2 July 23rd 09 06:59 AM
file format or file extension is not valid...error message Ballun Excel Discussion (Misc queries) 0 May 7th 09 09:06 PM
Different format than specified by the file extension! Peter R Hawkes Excel Discussion (Misc queries) 1 December 28th 07 03:07 PM
Additional file with no extension created during File Save As proc Peter Rooney Excel Discussion (Misc queries) 2 August 11th 05 02:48 PM
I need to download an exel spreadsheet file. (file extension :xls) buckrogers Excel Discussion (Misc queries) 2 December 8th 04 11:08 PM


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