Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to open, Update links, save and close workbooks | Excel Discussion (Misc queries) | |||
How to close all open workbooks in Excel 2007 | Setting up and Configuration of Excel | |||
Workbooks Close, but window stays open | Excel Discussion (Misc queries) | |||
Open Close workbooks | Excel Discussion (Misc queries) | |||
Can I have a loop to open a set of workbooks get some data, close it one a time. | Excel Programming |