PC Review


Reply
Thread Tools Rate Thread

call new workbook

 
 
Kirsty
Guest
Posts: n/a
 
      21st May 2009
I am trying to have my macro open a workbook during the run.
I recorded the macro, and opened the workbook, however, when I now run the
workbook, this is not working. Can anyone help me with how to open a new
workbook during a macro
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      21st May 2009
'To open new workbook
Workbooks.Add

'To open existing workbook
workbooks.Open "<filename>"
--
If this post helps click Yes
---------------
Jacob Skaria


"Kirsty" wrote:

> I am trying to have my macro open a workbook during the run.
> I recorded the macro, and opened the workbook, however, when I now run the
> workbook, this is not working. Can anyone help me with how to open a new
> workbook during a macro

 
Reply With Quote
 
Patrick Molloy
Guest
Posts: n/a
 
      21st May 2009
DIM wb as WorkBook
SET wb = Workbooks.Add()

you can now control the workbook using the variable

eg save is
wb.SaveAs {params}
wb.Close {params}

DIM ws as Worksheet
set ws = wb.ActiveSheet

and so on



"Kirsty" <(E-Mail Removed)> wrote in message
newsC5FD7A1-3E77-429E-990B-(E-Mail Removed)...
> I am trying to have my macro open a workbook during the run.
> I recorded the macro, and opened the workbook, however, when I now run the
> workbook, this is not working. Can anyone help me with how to open a new
> workbook during a macro


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I call up a line of code that references a cell/range in theactive workbook workbook where I am running my macro from? Lav Microsoft Excel Programming 1 11th Nov 2008 05:04 PM
Call function from other workbook. Joe Microsoft Excel Programming 1 4th Jan 2008 11:57 AM
How do I call number values form one workbook to another workbook Teryn Microsoft Excel Worksheet Functions 3 29th Dec 2007 09:21 AM
Re: need macro to call a workbook w/o the actual name of the workbook Jon Peltier Microsoft Excel Programming 0 18th Dec 2006 10:01 PM
Call function from one workbook that resides in another workbook m =?Utf-8?B?RGF0YXNvcnQ=?= Microsoft Excel Programming 3 16th Jan 2005 10:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:06 PM.