Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
KJ KJ is offline
external usenet poster
 
Posts: 43
Default save as macro

Here is a macro I created. Run I run the macro it creates the new file with
the correct filename in the correct location. However I still have the
previous (Book1) file open.
What I want is to close Book1 without saving.

Any help would be greatly appreciated.
Thanks, Ken.

Sub copyws()
Dim strName As String
Dim ws As Worksheet
strName = "C:\Documents and Settings\Ken1\My Documents\Quotes\" &
Range("A1").Value
Set ws = ThisWorkbook.Sheets(1)
Application.Workbooks.Add
ws.Copy befo=ActiveWorkbook.Sheets(1)
ActiveWorkbook.SaveAs strName

Set ws = Nothing

End Sub

 
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 as frageo64 Excel Discussion (Misc queries) 2 November 13th 07 06:57 AM
MACRO SAVE HELP DP7 Excel Worksheet Functions 2 October 17th 07 08:01 PM
Please help macro for save DP7 Excel Worksheet Functions 1 October 11th 07 10:31 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
Macro-Save as Lois Excel Discussion (Misc queries) 4 May 20th 05 10:53 PM


All times are GMT +1. The time now is 11:04 PM.

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"