LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro misteriously crashes Excel 2007 - but not 2003

I - unfortunately - use Excel 2007. I wrote a macro for the following
task:

- a folder contains a number of files, each with 3 tabs, "Source
Data", "Details" and "Summary". These files are reports, all in the
same format as they are created by
another macro. "Details" and "Summary" contain formulas based on the
content of "Source Data"

- the macro cycles through all files in the folder and merges them in
2 files, pasting values only and leaving out the source data

- the output is therefore 2 files: "MergedDetails" and
"MergedSummaries"; each of those files contains one tab per original
source file. For example, if you want to quickly compare the details
of File1 and File2, you'll open MergedDetails and compare the tabs
File1 and File2. Same for the summaries.

The problem is, my code kept crashing Excel. To isolate the problem, I
separated the code into 2 different macros: one for the details and
one for the summary.
The latter works, the former keeps crashing Excel.

I tried all sorts of workarounds: I ran the macro on local (rather
than network) folders, I set 2 to 4 second delays before closing and
saving files, but nothing changed.

The weirdest thing is that, debugging the code, I noticed that Excel
always crashed at different points in the macro: sometimes after
processing the 3rd file, some other time after processing the 8th,
sometimes after closing one file, some other time after copying some
cells... I never got any out of memory error.

I don't get this. If my code is wrong, why does Excel always crash at
different points in the code?

Finally, I tried the very same code on a different PC running Excel
2003 (and on the very same source files), and it does work fine!

Would you have any suggestions on how I can get my code to run with
Excel 2007? Or at least on how I can get some additional help?

I know some Excel 2007 macro functionalities are no longer supported (
like Application.Filesearch, for instance), but at least in those
cases you get a clear error message that helps you understand what the
issue is!

 
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
Excel 2007 crashes when perform SAVE AS to Excel 97-2003 Bagia Excel Discussion (Misc queries) 0 May 20th 09 04:21 AM
2007 slow vs 2003 and it crashes? Roger Excel Discussion (Misc queries) 6 April 6th 09 02:01 AM
Excel 2003 Crashes Al G. Excel Discussion (Misc queries) 1 February 1st 08 04:58 AM
xls file works fine in Excel 2000 and 2007 but crashes on opening in 2003 gromit12 Excel Discussion (Misc queries) 2 November 6th 07 09:30 PM
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 Joel Berry Excel Programming 9 March 6th 06 10:20 PM


All times are GMT +1. The time now is 11:08 AM.

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"