Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel File format List

I'm coding export functionality into my VB6 app, which incorporates an
excel file export, for which I use the Microsoft Excel 9.0 object
library. I would like to display the excel file formats available to
the user in a combo box.

How can I get a list of available formats at runtime ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel File format List

Douglas

Try this function:

'returns an array of strings containing descriptions of the possible save as options
Private Function AllSaveAsOptions() As Variant

Dim ret_val() As String
Dim fdfs As FileDialogFilters
Dim this_fdf As Long

'Set the FileDialogFilters collection variable to
'the FileDialogFilters collection of the SaveAs dialog box.
Set fdfs = Application.FileDialog(msoFileDialogSaveAs).Filter s

'make the array big enough
ReDim ret_val(fdfs.Count)

'Iterate through the description and extensions of each
'default filter in the SaveAs dialog box.
For this_fdf = 1 To fdfs.Count
ret_val(this_fdf) = fdfs.Item(this_fdf).Description
Next fdf

'and return the array
AllSaveAsOptions = ret_val
End Function

Hope that helps.

Iain


(Douglas Lund) wrote in message om...
I'm coding export functionality into my VB6 app, which incorporates an
excel file export, for which I use the Microsoft Excel 9.0 object
library. I would like to display the excel file formats available to
the user in a combo box.

How can I get a list of available formats at runtime ?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel File format List

OP said: Microsoft Excel 9.0 object

Which is Excel 2000.

I believe Iain's solution would only work in xl2002 and later.



--
Regards,
Tom Ogilvy

Iain Sheetware wrote in message
om...
Douglas

Try this function:

'returns an array of strings containing descriptions of the possible save

as options
Private Function AllSaveAsOptions() As Variant

Dim ret_val() As String
Dim fdfs As FileDialogFilters
Dim this_fdf As Long

'Set the FileDialogFilters collection variable to
'the FileDialogFilters collection of the SaveAs dialog box.
Set fdfs = Application.FileDialog(msoFileDialogSaveAs).Filter s

'make the array big enough
ReDim ret_val(fdfs.Count)

'Iterate through the description and extensions of each
'default filter in the SaveAs dialog box.
For this_fdf = 1 To fdfs.Count
ret_val(this_fdf) = fdfs.Item(this_fdf).Description
Next fdf

'and return the array
AllSaveAsOptions = ret_val
End Function

Hope that helps.

Iain


(Douglas Lund) wrote in message

om...
I'm coding export functionality into my VB6 app, which incorporates an
excel file export, for which I use the Microsoft Excel 9.0 object
library. I would like to display the excel file formats available to
the user in a combo box.

How can I get a list of available formats at runtime ?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel File format List

OK, Thanks Tom.
Is there any way to do it using Excel 2000 object ?
If not, am I able to redistribute the Excel 2002 object to clients
without Excel 2002?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel File format List

Douglas

Try this function:

'returns an array of strings containing descriptions of the possible save as options
Private Function AllSaveAsOptions() As Variant

Dim ret_val() As String
Dim fdfs As FileDialogFilters
Dim this_fdf As Long

'Set the FileDialogFilters collection variable to
'the FileDialogFilters collection of the SaveAs dialog box.
Set fdfs = Application.FileDialog(msoFileDialogSaveAs).Filter s

'make the array big enough
ReDim ret_val(fdfs.Count)

'Iterate through the description and extensions of each
'default filter in the SaveAs dialog box.
For this_fdf = 1 To fdfs.Count
ret_val(this_fdf) = fdfs.Item(this_fdf).Description
Next fdf

'and return the array
AllSaveAsOptions = ret_val
End Function

Hope that helps.

Iain


(Douglas Lund) wrote in message om...
I'm coding export functionality into my VB6 app, which incorporates an
excel file export, for which I use the Microsoft Excel 9.0 object
library. I would like to display the excel file formats available to
the user in a combo box.

How can I get a list of available formats at runtime ?



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
Number Format on Excel File saved from .html file joyfulone Excel Discussion (Misc queries) 3 April 15th 09 12:07 AM
Convert Excel XLS file to Quickbooks QIF file format Paul Excel Discussion (Misc queries) 0 October 22nd 07 10:46 PM
cannot open excel file - says invalid file format - what to do? excelless diane Excel Discussion (Misc queries) 2 November 8th 06 03:13 AM
Convertion of Excel sheet file to .txt file format charu Excel Discussion (Misc queries) 2 June 27th 06 12:09 PM
How do I autosave a unique Excel file in the file format 03F67000 flyboy06 Setting up and Configuration of Excel 1 June 14th 06 11:11 PM


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