LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Trying to use VBA to save a copy of a workbook

Excellent, That works, Thanks a lot :)

"Chip Pearson" wrote:

Try something like

Sub DoSave()

Dim FName As Variant
FName = Application.GetOpenFilename("Excel Files (*.xls),*.xls")
If FName = False Then
' user cancelled.
Exit Sub
Else
If Dir(FName) < vbNullString Then
' file exists
If MsgBox("File: " & FName & _
" already exists. Overwrite it?", vbYesNo) = vbYes Then
Kill FName
Else
' don't overwrite existing file
Exit Sub
End If
End If
ThisWorkbook.SaveCopyAs Filename:=FName
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"kfell" wrote in message
...
Hello,

I'm trying to use VBA to save a copy of a workbook, I want to just save
the
values not all the formulas and links. So I've got the macro to copy the
sheet and then paste special with values only and then I want to Save it.
I
want to be prompted where to save it. I've tried using
activeworkbook.close
but because I have a workbook before close event macro it just closes
without
saving the changes.
Is there anyway I can either stop the before close macro running or can I
get SaveCopyAs to ask for a filename





 
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
Shared workbook - to save or not to save bluebird Excel Discussion (Misc queries) 1 November 14th 06 06:17 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
How do I save a workbook as a new workbook by using macros? KingKarl Excel Discussion (Misc queries) 4 November 10th 05 08:34 AM
How to save a file without overwrite or save a copy? SettingChange Setting up and Configuration of Excel 1 November 3rd 05 02:10 AM
How can I save an editable copy of a protected excel workbook? randyice Excel Discussion (Misc queries) 1 December 23rd 04 09:01 PM


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