Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.





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
Help with getsaveasfilename Jo Excel Discussion (Misc queries) 2 June 5th 07 12:41 AM
GetSaveAsFilename not working in Excel 2003 Mayur Patel Excel Discussion (Misc queries) 8 September 11th 05 08:44 PM
GetSaveAsFilename method Donna Brooks Excel Programming 6 January 27th 04 10:37 PM
GetSaveAsFileName Not Working Dan Gesshel Excel Programming 1 September 25th 03 03:28 AM
Excel 2002 GetSaveAsFileName Kevin May Excel Programming 1 September 23rd 03 03:33 AM


All times are GMT +1. The time now is 11:15 AM.

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"