Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dhatul
 
Posts: n/a
Default Problems in running a macro in another workbook

I had raised a problem earlier at the following link. However no one
has responded.


http://groups.google.com/group/micro...6115afd866b041

While trying to tinker with the macro to find a solution I am surprised
to find that even the following simple macro is not executing any line
after opening the other workbook -

Sub RunAll()
Workbooks.Open Filename:="C:\Data\GLIF\Test2148.xls"

Workbooks("Test2148.xls").Activate

' nothing below this line is being executed

Sheets("2148").Select
Sheets("Summary").Select
Sheets("RawData").Select
ActiveWorkbook.Save
ActiveWorkbook.Close

Sheets("Movement").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Can someone suggest a solution?

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Problems in running a macro in another workbook

Do you mean that the newly opened workbook doesn't get saved and closed? The
sheet selecting seems somewhat redundant.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"dhatul" wrote in message
oups.com...
I had raised a problem earlier at the following link. However no one
has responded.



http://groups.google.com/group/micro...6115afd866b041

While trying to tinker with the macro to find a solution I am surprised
to find that even the following simple macro is not executing any line
after opening the other workbook -

Sub RunAll()
Workbooks.Open Filename:="C:\Data\GLIF\Test2148.xls"

Workbooks("Test2148.xls").Activate

' nothing below this line is being executed

Sheets("2148").Select
Sheets("Summary").Select
Sheets("RawData").Select
ActiveWorkbook.Save
ActiveWorkbook.Close

Sheets("Movement").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Can someone suggest a solution?



  #3   Report Post  
Posted to microsoft.public.excel.misc
CLR
 
Posts: n/a
Default Problems in running a macro in another workbook

Perhaps there is not a sheet named "2148" in Workbook Test2148.xls so the
macro just stops.........

Vaya con Dios,
Chuck, CABGx3

"dhatul" wrote:

I had raised a problem earlier at the following link. However no one
has responded.


http://groups.google.com/group/micro...6115afd866b041

While trying to tinker with the macro to find a solution I am surprised
to find that even the following simple macro is not executing any line
after opening the other workbook -

Sub RunAll()
Workbooks.Open Filename:="C:\Data\GLIF\Test2148.xls"

Workbooks("Test2148.xls").Activate

' nothing below this line is being executed

Sheets("2148").Select
Sheets("Summary").Select
Sheets("RawData").Select
ActiveWorkbook.Save
ActiveWorkbook.Close

Sheets("Movement").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub

Can someone suggest a solution?


  #4   Report Post  
Posted to microsoft.public.excel.misc
dhatul
 
Posts: n/a
Default Problems in running a macro in another workbook

Bob,

To respond to your query only the worksheet '2148' opens and nothing
happens after that. That is to say that no line are executed
thereafter. The selects are not redundant as these were written
precisely to check whether the macro is being executed or not.
Incidentally, the above small macro was written for debug purpose only,
to home down to the problem area. The real macro that I want to be
executed is in the link provided in my original post.

More importantly the entire macro works/executes perfectly in the debug
mode when executed line-by-line (F8).

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
Macro to open workbook and copy and paste values in to orig workbo Dena X Excel Worksheet Functions 1 December 15th 05 11:13 PM
How turn off macro security question for workbook with no marcos? Dewy Cheatum & Howe Excel Discussion (Misc queries) 2 December 9th 05 10:14 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
macro to browse for workbook, pick up data and looping uriel78 Excel Worksheet Functions 1 March 10th 05 12:37 PM


All times are GMT +1. The time now is 01:35 AM.

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"