Errore 5342 and "Not enough memory"

A

Antonio

Hi everybody,
I've got 2 PCs that are similar as for Operating System and office
application, exactly:
- Windows XP v.2002 SP3
- Office 2003 SP3 (11.8237.8221)
but they behave in different ways when executing a certain VBA macro.

Now, there's a Word file containing links to the graphics of an Excel file.
Every new year both of them must be copied and renamed. This done, the links
of the NEW Word document still refer to the OLD Excel sheet. In 2006 I
created a macro that selects the graphics one by one and modifies the links
addressing them to the NEW Excel sheet. All worked well!
Recently a new workstation (PC) has been added and allowed to access those
Word and Excel files and here is the problem:
First I open the Word document and then execute the VBA macro but during
compilation a Word message appears dealing with "Not enough memory" and
telling that it will not be possible to recover what is going to be modified
if I choose to continue. Then I try to go on and after a while (some links
are processed in the meantime) this VBA error message appears: "5342 -
Specified data type is unavailable".
So far the process stops and if try to double clik the links I got an Excel
error message telling that the "Available resources are insufficient. Try
with with less data or cloes other application. It's impossible to save
external links values".

More information:
1) Files pathnames are identical on every PC
2) The old and new Excel sheet are identical
3) PCs have different Hardware, but on the LESS POWERFUL evrything runs
correctly, and it has this configuration: AMD 64x2 Dual Core 5200+ 2.70GHz
con 1 Gb di RAM
4) I read a lot of Microsoft KB and I tried the registry modifcation as in
KB215573 but didn't solve the problem.

Here is the VBA macro:
Public Sub CambiaLink()
Dim intI As Integer

For intI = 1 To ActiveDocument.Fields.Count
With ActiveDocument.Fields(intI)
If .Type = 56 Then
.Select
.LinkFormat.SourceFullName =
"H:\DocumentiBilancio\BilPrev2009.xls"
End If
DoEvents
End With
Next intI


End Sub

Thanks in advance for your interest.
 
D

Doug Robbins - Word MVP on news.microsoft.com

Try the following:

For intI = 1 To ActiveDocument.Fields.Count
With ActiveDocument.Fields(intI)
If .Type = 56 Then
.LinkFormat.SourceFullName =
"H:\DocumentiBilancio\BilPrev2009.xls"
End If
.Update
End With
Next intI

There is no need to select the field and I imagine that the DoEvents was
intended to update the field.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
A

Antonio

Thanks for your help.
I used the .Select only to see which graphics of the Word document was in
process.
I use DoEvents as a rule.
In times past I tried Update but this didn't fix the 5342 error.
Today I used the code as you wrote it and that has solved the problem of
insufficient memory with Word but not the problem of the 5342 error and the
consequent Excel message that appears when opening the link: "Available
resources are insufficient. Try with less data or close other applications.
It's impossible to save external links values".

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top