ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   GetSaveAsFilename (https://www.excelbanter.com/excel-programming/280196-getsaveasfilename.html)

Anand Attavane

GetSaveAsFilename
 
I can't make this method work. I want to save the file as
formatted text file, i.e., .prn file. Here is my code:

Sub GetUserSaveFile()
Dim PPF As Variant
PPF = Application.GetSaveAsFilename("Ckdate.prn",
Filefilter:="*.prn")
ThisWorkbook.SaveAs Filename:=PPF
End Sub

I get application "Runtime Error 1004"
Method 'GetSaveAsFilename' of object "_Application' failed.

Thank you for your help.

Dan E[_3_]

GetSaveAsFilename
 
Anand,

You've got your file filter property set baddly Try

PPF = Application.GetSaveAsFilename("Ckdate.prn", "Formatted Text, *.prn")

FileFormat:="Type description, extension"

Dan E

"Anand Attavane" wrote in message ...
I can't make this method work. I want to save the file as
formatted text file, i.e., .prn file. Here is my code:

Sub GetUserSaveFile()
Dim PPF As Variant
PPF = Application.GetSaveAsFilename("Ckdate.prn",
Filefilter:="*.prn")
ThisWorkbook.SaveAs Filename:=PPF
End Sub

I get application "Runtime Error 1004"
Method 'GetSaveAsFilename' of object "_Application' failed.

Thank you for your help.




Tom Ogilvy

GetSaveAsFilename
 
Your next problem will be with the file SaveAs command

Dim PPF as String
Chdrive "C"
Chdir "C:\My folder1\Mysubfolder"
PPF = Application.GetSaveAsFilename( _
InitialFileName:="ckdate.prn", _
FileFilter:="Formatted Text (*.prn), *.prn")
ActiveWorkbook.SaveAs _
FileName:=ppf, _
FileFormat:=xlTextPrinter

--
Regards,
Tom Ogilvy



Dan E wrote in message
...
Anand,

You've got your file filter property set baddly Try

PPF = Application.GetSaveAsFilename("Ckdate.prn", "Formatted Text, *.prn")

FileFormat:="Type description, extension"

Dan E

"Anand Attavane" wrote in message

...
I can't make this method work. I want to save the file as
formatted text file, i.e., .prn file. Here is my code:

Sub GetUserSaveFile()
Dim PPF As Variant
PPF = Application.GetSaveAsFilename("Ckdate.prn",
Filefilter:="*.prn")
ThisWorkbook.SaveAs Filename:=PPF
End Sub

I get application "Runtime Error 1004"
Method 'GetSaveAsFilename' of object "_Application' failed.

Thank you for your help.







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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com