Discussion Locked

Memory Problem

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have written a Word Macro that processes large word files (over 10 million lines each) one after the other. The program works fine except somewhere in between stops saying 'insufficient memory'. If I try to run it further it says "Runtime error '4605': Method or property not available because there is a memory problem".

Can Anybody help?

5 replies

by dklippert

Try clearing the memory cache by saving every once in awhile.

(Type the Q number in the search box at www.microsoft.com/technet)

Out-of-Memory Error Message with Macro That Edits Document [Q279675]

Sub UpdateCount()

Dim count As Integer

count = 0

Options.AllowFastSave = False
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Execute findtext:=";", Forward:=True

While Selection.Find.Found = True
count = count + 1 Selection.TypeText Text:=vbTab

If count = 30 Then
ActiveDocument.Save
count = 0
End If

Selection.Find.Execute
Wend

End Sub

by danprem

I tried this solution but Saving the Doc in between does not seem to make any difference. I still get the same errors

by colesky

You have a bad DIMM or else the DIMM is inproperly seated on the motherboard. Pull out the DIMMS and reseat them. Then try again. If that doesn't work get some new DIMMS. If that STILL doesn't work...revise your code.

Cheers,

Colesky

by danprem

It is not a hardware problem since I have tried it on over ten machines with the same results. I have a simple character replacement procedure.

This discussion is closed to new replies.