Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with getsaveasfilename | Excel Discussion (Misc queries) | |||
GetSaveAsFilename | Excel Programming | |||
Help with GetSaveAsFilename | Excel Programming | |||
GetSaveasFileName | Excel Programming | |||
GetSaveAsFilename | Excel Programming |