LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default GetSaveAsFilename Troubles

Hello all,

I've been fighting with this for too long now, have searched the web
and groups and now come seeking your assistance.

I'm running XL2003 on XP Home.

As presented below, this snippet of code generates a runtime error 13,
type mismatch. On debug, it stops on this line:
If vFileSaveName < False Then

Hovering over the vFileSaveName shows a value of Error 2015.

Here's the kicker: if you take out the Excel 2007 line, it works just
fine. I actually have a few more file types I want to add. So I'm
wondering if there's a limit to the length of the filefilter parameter
or something. That doesn't make sense though because XL's own Save As
has much more than this (unless that's really a different dialog that
looks the same...)

I appreciate any and all help to get me over this hurdle. Completely
different alternate solutions are of course welcome as well.

Thanks,
Kruncher

Dim vSaveFileFilter As Variant
Dim vInitFile As Variant
Dim vTitle As Variant

'These are declared earlier in the module
' Dim fd As FileDialog
' Dim vFileSaveName As Variant

vTitle = "Select the export file to use."
vInitFile = ""

' this fails with run-time error 13 type mismatch
vSaveFileFilter = "Lotus 1-2-3 rel 1 (*.wks), *.wks, " & _
"Lotus 1-2-3 rel 2 (*.wk1), *.wk1, " & _
"Lotus 1-2-3 rel 3 (*.wk3), *.wk3, " & _
"Microsoft Excel (*.xls), *.xls, " & _
"Microsoft Excel 2007 (*.xlsx), *.xlsx, " & _
"Microsoft Access (*.mdb), *.mdb, " & _
"Paradox (*.db), *.db, " & _
"Web Page (*.htm;*.html), *.htm;*.html, " & _
"Adobe PDF (*.pdf), *.pdf"

vFileSaveName = _
Application.GetSaveAsFilename(vInitFile,
vSaveFileFilter, 1, vTitle)


If vFileSaveName < False Then
GetFileName = vFileSaveName
End If
 
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
Help with getsaveasfilename Jo Excel Discussion (Misc queries) 2 June 5th 07 12:41 AM
GetSaveAsFilename Syed Zeeshan Haider Excel Programming 2 December 8th 06 06:53 PM
Help with GetSaveAsFilename aj Excel Programming 0 March 23rd 06 08:32 PM
GetSaveasFileName Libby Excel Programming 1 September 8th 05 07:45 PM
GetSaveAsFilename Anand Attavane Excel Programming 2 October 22nd 03 01:21 AM


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