I am trying to make one of my macros open a file then switch back to the orignal file and then running the macro.
here is my code:
Please Login or Register to view this content.
I am trying to make one of my macros open a file then switch back to the orignal file and then running the macro.
here is my code:
Please Login or Register to view this content.
Last edited by randell.graybill; 04-30-2009 at 10:08 PM.
Please Login or Register to view this content.
It's not clar what you are doing, what is your code intended to do? The line to open a workbook is not used.
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Well all I want to do is open "C:\Documents and Settings\randell.graybill.DOMAIN99\My Documents\17Cycle Count Logs.xls".
Then switch back to the workbook that the macro was invoked from.
As far as what the rest of the macro does, is it formats the data from the workbook the macro was invoked from deletes bunk data moves it to 17Cycle Count Logs.xls then closes the workbook the macro was run on.
And thanks for taking the time to reply
Something like this
Please Login or Register to view this content.
I get the follow error message with your code:
I don't get this error if I don't try to open 17Cycle Count Logs before I run the rest of the code.Please Login or Register to view this content.
That has nothing to do with my code. The code that i gave you does exactly what you asked - opens the workbook then activates the workbook containing the code.
Why do I not get that error without the coded to open the other workbook then if it has nothing to do with the code trying to open the workbook?
maybe your code is looking for a range in the newly opened workbook. Not sure without working my way through all the code. This doesn't specify which workbook you are using
Please Login or Register to view this content.
Try to do so:
Regards,Please Login or Register to view this content.
Antonio
try this
Workbooks.Open Filename:="C:\Documents and Settings\randell.graybill.DOMAIN99\My Documents\17Cycle Count Logs.xls"
windows("macro file name").activate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks