Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default help with macro to open and close workbooks

all this macro does is save the Summary Report Master worbook and
create a copy of it in another folder
everything works fine up untill this point
as you can see i then select the workbook Data Summary Report Query
and try to close it
but it will not close
can anyone point me in the right direction
cheers
aneurin

Sub Main()
Sheets("Data Summary").Select
Range("A6").Select
ChDir "c:\Documents and Settings\Desktop"
Workbooks.Open Filename:= _
"c:\Documents and Settings\Desktop\Summary Report Master.xls"
Sheets("Data Summary").Select
Windows("Data Summary Report Query.xls").Activate
Range("a1:h20").Select
Selection.Copy
Windows("Data Summary Report Master.xls").Activate
Sheets("Data Summary").Select
Range("A6").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Range("A6").Select
Windows("Data Summary Report master.xls").Activate
Application.Run "'Data Summary Report master.xls'!saveit"
Windows("Data Summary Report Query.xls").Activate
Sheets("data summary").Select
Range("a1").Select
'saveitn
Application.DisplayAlerts = False
ActiveWorkbook.Close
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default help with macro to open and close workbooks

hi

correct me if i'm wrong... but i think perhaps u need to close the
active window, * ActiveWindow.Close * instead of * ActiveWorkbook.Close
* (2nd last line)

cheers



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

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 open, Update links, save and close workbooks Anton Excel Discussion (Misc queries) 0 January 7th 10 03:18 AM
How to close all open workbooks in Excel 2007 Alojz Setting up and Configuration of Excel 0 September 17th 09 11:04 PM
Workbooks Close, but window stays open Mari Excel Discussion (Misc queries) 2 January 16th 08 09:00 PM
Open Close workbooks bbc1 Excel Discussion (Misc queries) 2 August 28th 05 11:24 AM
Can I have a loop to open a set of workbooks get some data, close it one a time. wellie Excel Programming 2 July 9th 03 04:58 AM


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