ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro not finishing due to loading workbook (https://www.excelbanter.com/excel-discussion-misc-queries/206256-macro-not-finishing-due-loading-workbook.html)

David P.

Macro not finishing due to loading workbook
 
I have a macro that opens another workbook but it appears that the macro
fails to finish because it's almost like it's not waiting for it to load.
Essentially this is what I'm doing:

Workbook A is open
Macro to open Workbook B (this takes a second to load therefore cancelling
the rest of the macro)
Copy selected text from B
Close Workbook B
Paste info on Workbook A

Your help appreciated.
--
David P.

Jim Thomlinson

Macro not finishing due to loading workbook
 
Post your code...
--
HTH...

Jim Thomlinson


"David P." wrote:

I have a macro that opens another workbook but it appears that the macro
fails to finish because it's almost like it's not waiting for it to load.
Essentially this is what I'm doing:

Workbook A is open
Macro to open Workbook B (this takes a second to load therefore cancelling
the rest of the macro)
Copy selected text from B
Close Workbook B
Paste info on Workbook A

Your help appreciated.
--
David P.


Jim Rech

Macro not finishing due to loading workbook
 
Macro to open Workbook B

How do you execute this macro? Keyboard shortcut?

--
Jim
"David P." wrote in message
...
|I have a macro that opens another workbook but it appears that the macro
| fails to finish because it's almost like it's not waiting for it to load.
| Essentially this is what I'm doing:
|
| Workbook A is open
| Macro to open Workbook B (this takes a second to load therefore cancelling
| the rest of the macro)
| Copy selected text from B
| Close Workbook B
| Paste info on Workbook A
|
| Your help appreciated.
| --
| David P.


David P.

Macro not finishing due to loading workbook
 
Now I'm really going to confuse you. I'm assuming the macro stops running at
Workbooks.Open Filename:="C:\Windows Template.xls" .

Sheets("P").Select
Range("I13").Select
Workbooks.Open Filename:="C:\Windows Template.xls"
Sheets("2").Select
Selection.Copy
ActiveWindow.WindowState = xlMinimized
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Paste
ActiveWindow.WindowState = xlMinimized
Windows("Windows Template.xls").Activate
ActiveWindow.Close

--
David P.


"Jim Thomlinson" wrote:

Post your code...
--
HTH...

Jim Thomlinson


"David P." wrote:

I have a macro that opens another workbook but it appears that the macro
fails to finish because it's almost like it's not waiting for it to load.
Essentially this is what I'm doing:

Workbook A is open
Macro to open Workbook B (this takes a second to load therefore cancelling
the rest of the macro)
Copy selected text from B
Close Workbook B
Paste info on Workbook A

Your help appreciated.
--
David P.


David P.

Macro not finishing due to loading workbook
 
Yes, by keyboard shortcut.
--
David P.


"Jim Rech" wrote:

Macro to open Workbook B


How do you execute this macro? Keyboard shortcut?

--
Jim
"David P." wrote in message
...
|I have a macro that opens another workbook but it appears that the macro
| fails to finish because it's almost like it's not waiting for it to load.
| Essentially this is what I'm doing:
|
| Workbook A is open
| Macro to open Workbook B (this takes a second to load therefore cancelling
| the rest of the macro)
| Copy selected text from B
| Close Workbook B
| Paste info on Workbook A
|
| Your help appreciated.
| --
| David P.



Dave Peterson

Macro not finishing due to loading workbook
 
Remove the shift key from the shortcut combination.

Holding down the shiftkey while you're opening a file tells excel not to run the
workbook_open event or the auto_open procedure. And it confuses excel so that
it never goes back to finish your code.

David P. wrote:

Yes, by keyboard shortcut.
--
David P.

"Jim Rech" wrote:

Macro to open Workbook B


How do you execute this macro? Keyboard shortcut?

--
Jim
"David P." wrote in message
...
|I have a macro that opens another workbook but it appears that the macro
| fails to finish because it's almost like it's not waiting for it to load.
| Essentially this is what I'm doing:
|
| Workbook A is open
| Macro to open Workbook B (this takes a second to load therefore cancelling
| the rest of the macro)
| Copy selected text from B
| Close Workbook B
| Paste info on Workbook A
|
| Your help appreciated.
| --
| David P.



--

Dave Peterson

Jim Rech

Macro not finishing due to loading workbook
 
What Dave said holds even if the workbook you're opening doesn't have any
macros. It kills the calling macro too.

--
Jim
"David P." wrote in message
...
| Yes, by keyboard shortcut.
| --
| David P.
|
|
| "Jim Rech" wrote:
|
| Macro to open Workbook B
|
| How do you execute this macro? Keyboard shortcut?
|
| --
| Jim
| "David P." wrote in message
| ...
| |I have a macro that opens another workbook but it appears that the
macro
| | fails to finish because it's almost like it's not waiting for it to
load.
| | Essentially this is what I'm doing:
| |
| | Workbook A is open
| | Macro to open Workbook B (this takes a second to load therefore
cancelling
| | the rest of the macro)
| | Copy selected text from B
| | Close Workbook B
| | Paste info on Workbook A
| |
| | Your help appreciated.
| | --
| | David P.
|
|


David P.

Macro not finishing due to loading workbook
 
That's the problem. Thank you Dave & both Jims.
--
David P.


"Dave Peterson" wrote:

Remove the shift key from the shortcut combination.

Holding down the shiftkey while you're opening a file tells excel not to run the
workbook_open event or the auto_open procedure. And it confuses excel so that
it never goes back to finish your code.

David P. wrote:

Yes, by keyboard shortcut.
--
David P.

"Jim Rech" wrote:

Macro to open Workbook B

How do you execute this macro? Keyboard shortcut?

--
Jim
"David P." wrote in message
...
|I have a macro that opens another workbook but it appears that the macro
| fails to finish because it's almost like it's not waiting for it to load.
| Essentially this is what I'm doing:
|
| Workbook A is open
| Macro to open Workbook B (this takes a second to load therefore cancelling
| the rest of the macro)
| Copy selected text from B
| Close Workbook B
| Paste info on Workbook A
|
| Your help appreciated.
| --
| David P.



--

Dave Peterson



All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com