Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default SAVE AS MACRO

Hello Gurus, I am trying to create a macro so when the user clicks the save
as command box will appear and then they type in the file name and save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default SAVE AS MACRO

Add this code to the bottom

ActiveWorkbook.SaveAs flToSave, flFormat
OR
ActiveWorkbook.SaveCopyAs flToSave

If this post helps click Yes
---------------
Jacob Skaria


"Neil Holden" wrote:

Hello Gurus, I am trying to create a macro so when the user clicks the save
as command box will appear and then they type in the file name and save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default SAVE AS MACRO

That just gets a path, you have to explicitly save it

Activeworkbook.SaveAs flToSave

--
__________________________________
HTH

Bob

"Neil Holden" wrote in message
...
Hello Gurus, I am trying to create a macro so when the user clicks the
save
as command box will appear and then they type in the file name and save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file
name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 163
Default SAVE AS MACRO

Thanks guys, that was helpful!!! BUT... lol the annoying thing is now is
when the button is:

The lazy users have to click to the desired location (which will be in the
same folder)

The path is: M:\Contract\Current\Nationwide\Templates\Project
Brief&SOR\Project Briefs to be Approved prior to sending inc master SOR
Project brief/

Then they type the name of the file in. Is they anyway it can default to
that location and then the users type in the save as name.

Thanks again.

"Bob Phillips" wrote:

That just gets a path, you have to explicitly save it

Activeworkbook.SaveAs flToSave

--
__________________________________
HTH

Bob

"Neil Holden" wrote in message
...
Hello Gurus, I am trying to create a macro so when the user clicks the
save
as command box will appear and then they type in the file name and save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file
name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default SAVE AS MACRO

Dim flToSave As String
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat
flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"

'If it is same as the current workbook
flToSave = ActiveWorkbook.Path
OR
'If it is a different path assign to that variable
flToSave = "m:\contract\"

ActiveWorkbook.SaveAs flToSave & "\" & flName, flFormat
OR
ActiveWorkbook.SaveCopyAs flToSave & "\" & flName


If this post helps click Yes
---------------
Jacob Skaria


"Neil Holden" wrote:

Thanks guys, that was helpful!!! BUT... lol the annoying thing is now is
when the button is:

The lazy users have to click to the desired location (which will be in the
same folder)

The path is: M:\Contract\Current\Nationwide\Templates\Project
Brief&SOR\Project Briefs to be Approved prior to sending inc master SOR
Project brief/

Then they type the name of the file in. Is they anyway it can default to
that location and then the users type in the save as name.

Thanks again.

"Bob Phillips" wrote:

That just gets a path, you have to explicitly save it

Activeworkbook.SaveAs flToSave

--
__________________________________
HTH

Bob

"Neil Holden" wrote in message
...
Hello Gurus, I am trying to create a macro so when the user clicks the
save
as command box will appear and then they type in the file name and save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file
name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default SAVE AS MACRO

Dim flToSave As Variant
Dim flName As String
Dim flFormat As Long

ChDir ThisWorkbook.Path
flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")



--
__________________________________
HTH

Bob

"Neil Holden" wrote in message
...
Thanks guys, that was helpful!!! BUT... lol the annoying thing is now is
when the button is:

The lazy users have to click to the desired location (which will be in the
same folder)

The path is: M:\Contract\Current\Nationwide\Templates\Project
Brief&SOR\Project Briefs to be Approved prior to sending inc master SOR
Project brief/

Then they type the name of the file in. Is they anyway it can default to
that location and then the users type in the save as name.

Thanks again.

"Bob Phillips" wrote:

That just gets a path, you have to explicitly save it

Activeworkbook.SaveAs flToSave

--
__________________________________
HTH

Bob

"Neil Holden" wrote in message
...
Hello Gurus, I am trying to create a macro so when the user clicks the
save
as command box will appear and then they type in the file name and
save.

The code below brings the save as prompt up but doesn't save : (

Please help.

Dim flToSave As Variant 'brings up save as dialogue filling in file
name
with Job number
Dim flName As String
Dim flFormat As Long

flFormat = ActiveWorkbook.FileFormat

flName = Sheets("summary").Range("f7").Value & _
" " & Sheets("summary").Range("f8").Value & " " & "CHR
for
Monthly Update" & ".xls"
flToSave = Application.GetSaveAsFilename(flName, filefilter:="Excel
Files (*.xls),*.xls", _
Title:="Save File As...")






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
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
"Save" macro problem, still prompted to save when closing workbook (?) StargateFanFromWork[_4_] Excel Programming 8 September 13th 06 04:49 PM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


All times are GMT +1. The time now is 02:21 AM.

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"