Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default call new workbook

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default call new workbook

'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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default call new workbook

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" wrote in message
...
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
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 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 Excel Programming 2 November 11th 08 05:04 PM
How do I call number values form one workbook to another workbook Teryn Excel Worksheet Functions 3 December 29th 07 09:21 AM
need macro to call a workbook w/o the actual name of the workbook Jon Peltier Excel Programming 0 December 18th 06 10:01 PM
Call subroutine from another workbook DejaVu[_55_] Excel Programming 2 November 3rd 05 04:12 PM
Call function from one workbook that resides in another workbook m Datasort Excel Programming 3 January 16th 05 10:33 PM


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