Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Lyndon Rickards
 
Posts: n/a
Default Macro or OLE method to insert worksheet from template workbook

Greetings,

I'm not getting what I need from a recorded macro, but there is a
safe way, right?

Having created a workbook 'workbook1' using OLE, I am inserting a
'cover' worksheet from a template workbook, by opening that template
workbook which seems to automatically (reliably?) become the active one,
and copying the sheet to workbook1. So far so good.

Now I need to close out the template workbook and return to the
newly inserted sheet in workbook1 and populate some cells.

However, (Excel2003) workbook1 does not seem reliably to become active
and so the script terminates unexpectedly. Recording a macro while
closing one workbook and activating another just produces:

ActiveWindow.Close
ActiveWindow.WindowState = xlNormal

I want to use the *name* of the workbook, explicitly make it active
before I do stuff instead of chancing on whatever winds up active... The
syntax is escaping me - help please?

TIA - Lynn.

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
How can I get a validation to run in a macro on a shared workbook? arewa Excel Discussion (Misc queries) 3 January 2nd 06 11:31 PM
How do I insert just one worksheet of a workbook into an email? Sarah Excel Discussion (Misc queries) 2 December 19th 05 08:17 PM
quickly create extra copies of a worksheet template in a workbook simon Excel Worksheet Functions 2 October 23rd 05 07:04 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM


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