Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Run-time error €˜13 mismatch type

Hi,

The following code work fine until I try to added the 7th filefilter. I want
to have 21 different filefilter or 24 filefilter. If I can find out the
FileFormatValue for (*.xml), (*.xlam), and (*.xla).

The question is how to get my code to have more than 6 filefilter without
having a run-time error 13.

My Code

NewFullName = Application.GetSaveAsFilename(InitialFileName:=(My FullName),
filefilter:= _
" Excel Workbook (*.xlsx), *.xlsx," & _
" Excel Macro-Enabled Workbook (*.xlsm), *.xlsm," & _
" Excel Binary Workbook (*.xlsb), *.xlsb," & _
" Excel 97-2003 Workbook (*.xls), *.xls," & _
" Single File Web Page (*.mht; *.mhtml), *.mht; *.mhtml," & _
" SYLK (Symbolic link) (*.slk), *.slk", _
FilterIndex:=1)

I still want to add 14 more filefilter between Single file web page and SYLK:

" Web Page (*.htm; *.html), *.htm; *.html," & _
" Excel Template (*.xltx), *.xltx," & _
" Excel Macro-Enabled Template (*.xltm), *.xltm," & _
" Excel 97-2003 Template (*.xlt), *.xlt," & _
" Text (Tab delimited) (*.txt), *.txt," & _
" Unicode Text (*.txt), *.txt," & _
" XML Spreadsheet 2003 (*.xml), *.xml," & _
" Microsoft Excel 5.0/95 Workbook (*.xls), *.xls," & _
" CSV (Comma delimited) (*.csv), *.csv," & _
" Formatted Text (Space delimited) (*.prn), *.prn," & _
" Text (Macintosh) (*.txt), *.txt," & _
" Text (MS-DOS) (*.txt), *.txt," & _
" CSV (Macintosh) (*.csv), *.csv," & _
" CSV (MS-DOS) (*.csv), *.csv," & _
" DIF (Data Interchange Format) (*.dif), *.dif," & _

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Run-time error €˜13 mismatch type

Hi,

I am not sure that you are on the right track for what you are trying to
achieve. I have given examples of 2 methods you might like to try.

You would normally only have one file filter and that is the one that you
want the user to use for the save. Something like the following adapted from
xl help.

Sub testFileSaveAs()
Dim fileSaveName

fileSaveName = Application.GetSaveAsFilename _
(fileFilter:= _
"Text Files (*.txt), *.txt", _
InitialFileName:="Test Save As")

If fileSaveName < False Then
MsgBox "Save as " & fileSaveName
Else
MsgBox "User cancelled without saving."
End If
End Sub

If you want the SaveAs dialog box to allow the user to select the file type
then try the following code.

Sub testFileSaveAs1()

Dim diaSaveAs As Dialog

Set diaSaveAs = Application.Dialogs(xlDialogSaveAs)

With diaSaveAs
If .Show Then
MsgBox "File saved as filename: " _
& ThisWorkbook.Name
Else
MsgBox "User cancelled without saving"
End If
End With

End Sub

Hope this helps.

--
Regards,

OssieMac

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
run time error 13 type mismatch Rob Bovey Excel Programming 3 April 13th 10 12:09 PM
Run-Time error, type Mismatch T De Villiers[_79_] Excel Programming 1 July 31st 06 03:28 PM
Run-time error 13, Type Mismatch T De Villiers[_73_] Excel Programming 2 July 31st 06 03:01 PM
Run Time Error 13 Type Mismatch ExcelMonkey Excel Programming 3 October 12th 05 12:51 PM
run time error 13 type mismatch kkknie[_170_] Excel Programming 0 July 20th 04 03:28 PM


All times are GMT +1. The time now is 07:03 AM.

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"