I am creating a macro.
The macro open a file, copy an area & paste to another area.
The this file to be closed. But I always have a massage (See file attached) . This will delay the process as I have to choose "Yes" or "No".
Thanks for your reply. In fact I do not understand clearly.
Can you add to this macro so that the message is not shown :
Sub XX()
Workbooks.Open Filename:="C:\SAPworkdir\tg1.xls"
Range("A1:C500").Select
Selection.Copy
Windows("CL.xls").Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Windows("tg1.xls").Activate
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
what i usually do is that i copy an empty cell befor quiting
and if you don't want to save you type this instead of ActiveWorkbook.Save
Active workbook.saved = true
visual basic code:--------------------------------------------------------------------------------
Sub XX()
Workbooks.Open Filename:="C:\SAPworkdir\tg1.xls"
Range("A1:C500").Copy
Windows("CL.xls").Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Windows("tg1.xls").Activate
Range("D1").copy
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
--------------------------------------------------------------------------------