Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default use a macro to close a file

The you for your answer.
The previous posting from Bob P. is a bit more in line as all I needed to do
was to clear the clipboard.
This way I do not need to remember to reset the Message Alert system.

Dan


"quartz" wrote:

Try placing the following before the point that the prompt is generated:

Application.DisplayAlerts = False

Be sure to reset it at the end of your code as follows:

Application.DisplayAlerts = True

Hope this helps.


"wtpcomplab" wrote:

I have a macro set in 1 workbook that opens a different workbook, copies
information to past into the first workbook then closes the second workbook.
My problem is how do I set the close command to close the second file
without the system message about data on the clipboard - save yes or no?
See code below.
Thank you in advance Dan

Sub Load_Group()
'
GroupNum = Application.InputBox(prompt:=" ENTER A GROUP NUMBER",
Type:=1)
Dim GrpNum As String
GrpNum = GroupNum & ".xls"

ChDir "C:\DATA FILES"
Workbooks.Open Filename:= _
"C:\DATA FILES\Print Out #" & (GrpNum)
Range("A2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Copy
Windows("Invoice_AND_Total_Sheet.xls").Activate
Range("AH3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Windows("Print Out #" & (GrpNum)).Activate
ActiveWorkbook.Close
Range("A1").Select
Calculate
End Sub

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
Using Macro to Close Word File dwake Excel Discussion (Misc queries) 3 December 3rd 09 02:04 AM
How to close a excel file using Macro coding? Eric Excel Discussion (Misc queries) 1 June 11th 07 08:49 AM
Macro to Open, then Close another File HROBERTSON Excel Discussion (Misc queries) 1 January 8th 07 06:41 PM
close file macro Will Fleenor Excel Programming 3 October 21st 04 05:49 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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