473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crashes macro application in Microsoft Excel 97 under Windows XP

3 New Member
I am running a VBA macro application in Microsoft Excel 97 under Windows XP -Service Pack 1 to,
1.Open an Excel work book .
2.Update a value in a cell
3.Save and close the file.
I need to repeat the steps 1,2,3 for 1,00,000 times. But after executing the process around 32,000 times the Excel application crashes.The whole OS hangs. And a message box appears As
" Run time error -2147467259 (80004005) ", method 'open' of object workbook's failed.

I am facing this problem since last two weeks, If any body have the solution please comment it .

Thanks
Arun
Jan 21 '08 #1
2 1544
kadghar
1,295 Recognized Expert Top Contributor
I am running a VBA macro application in Microsoft Excel 97 under Windows XP -Service Pack 1 to,
1.Open an Excel work book .
2.Update a value in a cell
3.Save and close the file.
I need to repeat the steps 1,2,3 for 1,00,000 times. But after executing the process around 32,000 times the Excel application crashes.The whole OS hangs. And a message box appears As
" Run time error -2147467259 (80004005) ", method 'open' of object workbook's failed.

I am facing this problem since last two weeks, If any body have the solution please comment it .

Thanks
Arun
For the way you're describing it, i'd say there's an integer in the code (presumably in the file's name). Define it as a long.

Or you are creating a new object each time you open a workbook, this will create a new instance, and if you're not closing the ones before, and by a coincidence, your pc crashes when you reach 32K instances. But i'd say this is not the reason, since error (80004005) is a HDD or LAN error (correct me if not, please).
Jan 22 '08 #2
Killer42
8,435 Recognized Expert Expert
Seems simple enough to verify. Check exactly which number it bombs on. If it's file number 32768 or 32769, then the odds are very good that the problem is related to data size (number of bits).

However, the data-size problem could strike in an unexpected area. For example, what if the OS (or something along the chain, anyway) can't handle more than 32K files in a folder?

While you have a think about this, can we see the actual code?

Oh! Something else that comes to mind. Are you sure you're closing the files after opening them? Perhaps Excel is simply complaining that you're trying to open too many files at once.

Kadghar makes a good point, too. An integer value might "wrap around" after 32K, so you might think you're asking for file 32768, but actually be requesting a negative number.


P.S. Sorry, I just realised I may be making an invalid assumption here. I thought that you were using the number as part of the file name, and thus opening 32000 different files. But in fact I don't think you said that. Are you in fact working with the same file each time, or what?
Jan 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
41179
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created an excel document which the user can see (at this stage of development) and passed some data to it. I then used the savas method to save the file. Again this seems to work as the file is created. However once I close the excel file and try and...
4
10101
by: Rich Wallace | last post by:
Is there a way to open an Excel file and either respond to or supress the Macro warning window via VB.NET? Dim oExcel As Excel.Workbook Dim sFilePath As String = "C:\DailyReport.xls" oExcel = GetObject(sFilePath) --> Throws Macro warning window oExcel.Unprotect("password")
2
3552
by: cr113 | last post by:
I just upgraded from Office 2000 to Office 2003. My VB.NET Excel macro calls don't work any longer. Here is how I make my Excel macro call from VB.NET: Dim objExcel as Excel.Application objExcel = New Excel.Application objExcel.Workbooks.Open(FileName:="c:\test.xls", ReadOnly:=True) objExcel.Run("test.xls!test.test")
3
6984
by: Mr.Doubt | last post by:
I'm trying to run a Excel macro, which uses SOLVER.XLA Add-In, in VB.NET application. When the macro is executed I get the following error message "Solver: An unexpected internal error occured, or available memeory was exhausted" Any suggestions whats causing this error and how to debug it??? Also, I get the following exception message when executing all the
1
4125
by: cr113 | last post by:
We've upgraded from Office 2000 to Office 2003 and now my excel macro calls are messed up. There's about a 15 second delay from the time I make the call in VB.NET to the time the excel macro is actually executed. Here's my code: Dim oExcel As Microsoft.Office.Interop.Excel.Application oExcel = New Microsoft.Office.Interop.Excel.Application
2
2294
by: robert | last post by:
When employing complex UI libs (wx, win32ui, ..) and other extension libs, nice "only Python stack traces" remain a myth. Currently I'm hunting again a rare C-level crash bug of a Python based Windows app with rare user reports - and still in the dark (I get snippets of machine stack traces / screenshots with random "mem. access error" / "python caused the runtime to terminate in an unusual way" / ..) I'd like to hook a kind of quality...
2
17718
by: Senthil | last post by:
Hi All I need to create an Excel report and create a command button and have to run a macro on the click event that will print all the pages in the Excel workbook. I am able to create the report from the database but I am not sure how do I put a command button and associate a macro with that using C#. Can anyone help me?? Thanks in advance. Senthil
0
1512
by: developer200701 | last post by:
The following code (which is distilled down from a larger application) worked for several years previously. Now, the instant you click on the print icon within the print preview window the workstation crashes hard: reboots and upon Windows restart wants to send an error report to Microsoft (recovered from severe error). My default printer is HP LaserJet 5000N Series PCL6; if I select an alternative printer (different HP model) this...
1
2278
by: arun0580 | last post by:
I am running a VBA macro application in Microsoft Excel 97 under Windows XP -Service Pack 1 to, 1.Open an Excel work book . 2.Update a value in a cell 3.Save and close the file. I need to repeat the steps 1,2,3 for 1,00,000 times. But after executing the process around 32,000 times the Excel application crashes.The whole OS hangs. And a message box appears As Run time error -2147467259 (80004005) ", method 'open' of object workbook's...
7
93666
by: NeverLift | last post by:
This is probably answered elsewhere, but I've searched the Web and VBA for Excel manual, find no answers. I have a VBA-coded macro in an Excel workbook that is to open another existing workbook -- a .xls file, not .csv -- copy data from it, paste that into the original workbook where the macro resides, then close the source workbook. If I use the debugger to step through the macro -- putting a breakpoint at its first executable line, run...
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.