#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Closing a workbook

I have the following code.


Workbooks.Open Filename:="C:\Documents and Settings\earpn\Desktop\A"

Sheets("EmailList").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Report").Select
Range("A2").Select

I need to put this into the open procedure of the workbook thats being
opened in the first line of the code. So in the code i need to simply select
the workbook (A) and paste the code rather than open the workbook (A) and
paste the code.

I then need to close the workbook that i got the copied cells from. so i
need to select that workbook and close it and then select the workbook (A)
again.

The code above does work when i use it in a new excel workbook and copies
and pastes fine (but can't close the other book as i can't seem to select it).

Any help on selecting a workbook would be appreciated.

Thanks

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
Closing a protected workbook CurlyDave Excel Discussion (Misc queries) 5 February 8th 09 09:11 PM
Closing a workbook upon opening another Dave New Users to Excel 3 January 3rd 07 09:57 PM
STOP WORKBOOK CLOSING KandK Excel Discussion (Misc queries) 2 May 5th 06 09:40 AM
Help with closing down a workbook?? Don Excel Worksheet Functions 1 May 9th 05 04:05 AM
prohibit closing a workbook Christophero Excel Discussion (Misc queries) 2 April 4th 05 05:54 PM


All times are GMT +1. The time now is 12:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"