![]() |
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 |
All times are GMT +1. The time now is 06:00 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com