Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

Excel 2007: Flaky Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Olbert - 05 Mar 2008 17:32 GMT
I've got a weird situation with a macro that I'm not sure how to go about debugging. This is all within Excel 2007.

From time to time (i.e., not always), the macro fails at a point where I first load a workbook and then immediately save it as an
Excel 2003 file. And it fails by crashing Excel.

Here's the weird part: if I single-step through the macro it never fails. In other words, there's nothing wrong with the logic.

This feels like some kind of file system dependency coupled to a hidden asynchronous behavior in Excel. Like the file load isn't
complete but the macro "thinks" it is and continues on.

I tried inserting Application.Wait <delay 5 seconds> into the flow, but that didn't prevent the crashes.

How the heck do I debug something that works in the debugger but fails in use??

- Mark
Jim Rech - 05 Mar 2008 17:40 GMT
In cases like that I've added a Stop to the code, saved the workbook and
opened it.  If I get to the Stop I know the problem is after it so I moved
it ahead and tried again.  Eventually you should find the line that fails.
You might even be able to figure out why<g>.

Signature

Jim

| I've got a weird situation with a macro that I'm not sure how to go about debugging. This is all within Excel 2007.
|
[quoted text clipped - 11 lines]
|
| - Mark
Mark Olbert - 05 Mar 2008 18:35 GMT
Good idea...but, great ghu, what an ugly thing to have to do.

- Mark

>In cases like that I've added a Stop to the code, saved the workbook and
>opened it.  If I get to the Stop I know the problem is after it so I moved
>it ahead and tried again.  Eventually you should find the line that fails.
>You might even be able to figure out why<g>.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.