Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default GetSaveAsFilename not responding

I have the following code in a procedu
AUserFile = Application.GetSaveAsFilename(InitialFileName:=IFN , _
FileFilter:="Microsoft Office Excel Workbook(*.xls),*.xls", _
FilterIndex:=1, Title:="You Must Save Before You Proceed")

The box pops up with name I specify. The InitialFilename parameter fills in
as I specify. But when I click Save nothing happens. The file name remains
the same and when I look in the folder where I am trying to save the file
there's nothing there. Why doesn't it work?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default GetSaveAsFilename not responding

GetSaveAsFileName doesn't save the file. It only gets the name from the user.

Dim auserfile as variant
auserfile = application.getsaveasfilename(...)

if auserfile = false then
'user hit cancel, what should happen?
else
whateverworkbookyou'reworkingon.saveas filename:=auserfile, _
fileformat:=xlworkbooknormal
end if

Much like the suggestion you got in the other thread.

Bishop wrote:

I have the following code in a procedu
AUserFile = Application.GetSaveAsFilename(InitialFileName:=IFN , _
FileFilter:="Microsoft Office Excel Workbook(*.xls),*.xls", _
FilterIndex:=1, Title:="You Must Save Before You Proceed")

The box pops up with name I specify. The InitialFilename parameter fills in
as I specify. But when I click Save nothing happens. The file name remains
the same and when I look in the folder where I am trying to save the file
there's nothing there. Why doesn't it work?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default GetSaveAsFilename not responding

The GetSaveAsFilename function only returns the full path and filename to
'Save As'. Now that it is loaded into your variable, you must execute the
SaveAs method to actually save the file.

Example: ActiveWorkbook.SaveAs AUserFile

HTH
Kind regards, Garry
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default GetSaveAsFilename not responding

Isn't the fileformat for .xls 56 or xlExcel8, not xlWorkbookNormal (51?).

"Dave Peterson" wrote:

GetSaveAsFileName doesn't save the file. It only gets the name from the user.

Dim auserfile as variant
auserfile = application.getsaveasfilename(...)

if auserfile = false then
'user hit cancel, what should happen?
else
whateverworkbookyou'reworkingon.saveas filename:=auserfile, _
fileformat:=xlworkbooknormal
end if

Much like the suggestion you got in the other thread.

Bishop wrote:

I have the following code in a procedu
AUserFile = Application.GetSaveAsFilename(InitialFileName:=IFN , _
FileFilter:="Microsoft Office Excel Workbook(*.xls),*.xls", _
FilterIndex:=1, Title:="You Must Save Before You Proceed")

The box pops up with name I specify. The InitialFilename parameter fills in
as I specify. But when I click Save nothing happens. The file name remains
the same and when I look in the folder where I am trying to save the file
there's nothing there. Why doesn't it work?


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default GetSaveAsFilename not responding

xlworkbooknormal = -4143
in xl2003.

So I guess it would depend on what version of excel the OP is using.

Barb Reinhardt wrote:

Isn't the fileformat for .xls 56 or xlExcel8, not xlWorkbookNormal (51?).

"Dave Peterson" wrote:

GetSaveAsFileName doesn't save the file. It only gets the name from the user.

Dim auserfile as variant
auserfile = application.getsaveasfilename(...)

if auserfile = false then
'user hit cancel, what should happen?
else
whateverworkbookyou'reworkingon.saveas filename:=auserfile, _
fileformat:=xlworkbooknormal
end if

Much like the suggestion you got in the other thread.

Bishop wrote:

I have the following code in a procedu
AUserFile = Application.GetSaveAsFilename(InitialFileName:=IFN , _
FileFilter:="Microsoft Office Excel Workbook(*.xls),*.xls", _
FilterIndex:=1, Title:="You Must Save Before You Proceed")

The box pops up with name I specify. The InitialFilename parameter fills in
as I specify. But when I click Save nothing happens. The file name remains
the same and when I look in the folder where I am trying to save the file
there's nothing there. Why doesn't it work?


--

Dave Peterson


--

Dave Peterson
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
GetSaveAsFilename Dave Peterson Excel Programming 0 December 21st 06 04:33 PM
GetSaveAsFilename Syed Zeeshan Haider Excel Programming 2 December 8th 06 06:53 PM
GetSaveasFileName Libby Excel Programming 1 September 8th 05 07:45 PM
GetSaveAsFileName Greg Hadrych Excel Programming 1 July 29th 04 12:52 AM
GetSaveAsFilename Anand Attavane Excel Programming 2 October 22nd 03 01:21 AM


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