LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Subject out of range

In Book1 I run macro1 with the following code:

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
objExcel.DisplayAlerts = False

Set objWorkbook = objExcel.Workbooks.Open("C:\Program\Book2.xls")
Set objWorksheet = objWorkbook.Worksheets(1)

objWorkbook.Application.Run "'Book2.xls'!macro2"

objWorkbook.SaveAs ("Book3.xls")
objExcel.Quit

The opened workbook Book2 runs macro2 which needs information from the
first workbook
It contains the line:

Year = Workbooks("Book1.xls").Worksheets("Sheet1").Range( "A1")

When both files are opened and i run macro2 within Book2 everything
works fine. But when i run macro 1 it gives me a 'Subject out of
range'. Anyone a solution?

Thanks,

Xentis

 
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
No Subject No Name Excel Discussion (Misc queries) 0 August 8th 08 04:38 PM
Email Range of Cell Content to create subject and body from link Hahndo Excel Programming 2 September 23rd 05 11:46 PM
No Subject Excel Discussion (Misc queries) 0 January 24th 05 12:00 AM
Not sure what to name this subject MARTY Excel Programming 4 July 4th 04 03:49 PM
Defining the subject of an Email by value in range RPIJG[_31_] Excel Programming 5 June 8th 04 09:00 PM


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