I had raised a problem earlier at the following link. However no one
has responded.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:=quot;C:\Data\GLIF\Test2148.xlsquot;
Workbooks(quot;Test2148.xlsquot;).Activate
' nothing below this line is being executed
Sheets(quot;2148quot;).Select
Sheets(quot;Summaryquot;).Select
Sheets(quot;RawDataquot;).Select
ActiveWorkbook.Save
ActiveWorkbook.Close
Sheets(quot;Movementquot;).Select
ActiveWorkbook.Save
ActiveWorkbook.Close
End Sub
Can someone suggest a solution?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)
quot;dhatulquot; gt; wrote in message oups.com...
gt; I had raised a problem earlier at the following link. However no one
gt; has responded.
gt;
gt;
gt;
groups.google.com/group/micro...6115afd866b041
gt;
gt; While trying to tinker with the macro to find a solution I am surprised
gt; to find that even the following simple macro is not executing any line
gt; after opening the other workbook -
gt;
gt; Sub RunAll()
gt; Workbooks.Open Filename:=quot;C:\Data\GLIF\Test2148.xlsquot;
gt;
gt; Workbooks(quot;Test2148.xlsquot;).Activate
gt;
gt; ' nothing below this line is being executed
gt;
gt; Sheets(quot;2148quot;).Select
gt; Sheets(quot;Summaryquot;).Select
gt; Sheets(quot;RawDataquot;).Select
gt; ActiveWorkbook.Save
gt; ActiveWorkbook.Close
gt;
gt; Sheets(quot;Movementquot;).Select
gt; ActiveWorkbook.Save
gt; ActiveWorkbook.Close
gt; End Sub
gt;
gt; Can someone suggest a solution?
gt;
Perhaps there is not a sheet named quot;2148quot; in Workbook Test2148.xls so the
macro just stops.........
Vaya con Dios,
Chuck, CABGx3
quot;dhatulquot; wrote:
gt; I had raised a problem earlier at the following link. However no one
gt; has responded.
gt;
gt;
gt; groups.google.com/group/micro...6115afd866b041
gt;
gt; While trying to tinker with the macro to find a solution I am surprised
gt; to find that even the following simple macro is not executing any line
gt; after opening the other workbook -
gt;
gt; Sub RunAll()
gt; Workbooks.Open Filename:=quot;C:\Data\GLIF\Test2148.xlsquot;
gt;
gt; Workbooks(quot;Test2148.xlsquot;).Activate
gt;
gt; ' nothing below this line is being executed
gt;
gt; Sheets(quot;2148quot;).Select
gt; Sheets(quot;Summaryquot;).Select
gt; Sheets(quot;RawDataquot;).Select
gt; ActiveWorkbook.Save
gt; ActiveWorkbook.Close
gt;
gt; Sheets(quot;Movementquot;).Select
gt; ActiveWorkbook.Save
gt; ActiveWorkbook.Close
gt; End Sub
gt;
gt; Can someone suggest a solution?
gt;
gt;
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).
- Oct 05 Fri 2007 20:40
Problems in running a macro in another workbook
close
全站熱搜
留言列表
發表留言