Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro to Close a specific workbook.
Hello,
So what my macro does is look up on a "Macro Control" sheet of my workbook to get different variables based on the day to open and grab specific information. It is working fine up until the point that I try to close it. It stops at the "Windows (FN) .Activate". Can someone please tell me what I am doing wrong here or how I can somehow bypass this? Thanks so much! Dan Here is the part of the macro: Dim FN As String FN = Range("'Macro Control'!B7") Dim FNX As String FNX = Range("'Macro Control'!B7") Application.DisplayAlerts = False Workbooks.Open Filename:=FN Range("D1:W28").Select Selection.Copy Windows("Daily MTM Signoff Template.xls").Activate Sheets("Current Day CFlash Report").Select Range("D4").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False FN = Range("'Macro Control'!B7") FNX = Range("'Macro Control'!B7") Application.DisplayAlerts = False FN = Range("'Macro Control'!B7") Application.DisplayAlerts = False Windows(FN).Activate ActiveWorkbook.Close savechanges:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to close workbook with prompt | Excel Worksheet Functions | |||
Macro to close workbook and re-open new copy | Excel Discussion (Misc queries) | |||
VBA Code to kick off macro when workbook command to close is initi | Excel Discussion (Misc queries) | |||
Macro to copy specific cells from one workbook to another | Excel Discussion (Misc queries) | |||
run macro on workbook close | Excel Discussion (Misc queries) |