LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 89
Default running a Macro in 2007 which was created in 2003

Jon, thanks I'll try that next time I have a stall. :-) DoEvents.... right
got it.

"Jon Peltier" wrote:

If the code fails when run at full speed but works when stepped through,
all else being equal, it usually means Excel has some housekeeping to
do, that it hasn't finished before the command.

Inserting a one-word line

DoEvents

before the line that shows the error will often give Excel a chance to
do all that background stuff. Excel 2007 is more prone to this issue
than 2003.

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/


On 4/22/2010 5:25 AM, Kevryl wrote:
Hi Simon, you've got me, being new to 2007 too. No doubt someone will soon
give you a definitive answer soon, but until then...

I had a problem running a macro that tripped on the line,
"Windows("Accounting.xls").Activate" which was merely to switch between 2
windows in the one instance of Excel. It tripped the first time giving an
error message, so I went into debugging, stepping over all the commands up to
that one and then "stepped into" from there. It found its way through without
an issue and then worked perfectly after that. So its possible that if you do
the same, yours too may "settle in" (OK, some Excel geek can ridicule the
terminology, but it worked ;-). )

Remember that any commands before the one that tripped will have been
executed, so you may not want them to execute again! Turn on the "debug"
toolbar and use the "step over" and "step into" buttons. Be aware that the
"Continue" button (right-pointing triangle) will run from the point you're at
right to the end.

"Simon" wrote:

Hi there, I hope you can help, I am not VB literate unfortunately but I am
trying to run a macro with the following line of code which creates an error:

LastRow = Master_Wksht.Range("N"& Rows.Count).End(xlup).Row

Is there a change between versions which means this line won't work any more?



.

 
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
Linked spreadsheets created in 2003 but not working in 2007 Steve Excel Worksheet Functions 2 June 4th 09 04:33 PM
copy 2007 created macro to run in 2003 amaries Excel Discussion (Misc queries) 4 December 18th 08 07:48 PM
2007 Excel Add-in created in version 2003 but not valid add-in for oezkanoezkan Excel Discussion (Misc queries) 0 December 12th 08 11:36 AM
Cannot run Macro created in 2003 Gizmo Excel Discussion (Misc queries) 4 June 17th 08 04:28 PM
Macro Created but Not Running in Workbook alexaed Excel Worksheet Functions 9 August 14th 07 08:48 PM


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