0

So I have this function I wrote a year ago (on an old computer) that takes data from my excel file and creates pretty single-page summaries of the data in Publisher. I got it working well at the time, but now that I am revisiting it, I'm getting a "Windows is low on memory" runtime error in the very first part of the code. The error is occurring on the second line below:

Dim appPub As New Publisher.Application
appPub.Open Filename:="C:\Users\halle1\Documents\Temp.pub"
appPub.ActiveWindow.Visible = False
Dim DocPub As Document
Set DocPub = appPub.ActiveDocument

I suspect that the issue is a setting that is different on this new machine, but I have no idea what that might be. The above code is pretty much copy/pasted from the VBA documentation...

Any ideas or help would be greatly appreciated!

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • Windows being low on memory means that you're getting into shortage as far as the memory consumption of your computer is concerned. This may be due to the last action you have performed (3% current memory usage + 95% new memory usage = 98% memory usage is very close to 100%, due to new process), it can also be caused by other processes (95% current memory usage + 3% new memory usage = 98% memory usage is very close to 100%, due to previous processes). Use your task manager to check memory usage before and while running – Dominique Nov 02 '21 at 13:13
  • I have 16 GB of RAM and It didn't change at all when I tried to run the code. It's running at about 50% right now and the code doesn't seem to have affected it at all. – Zeke Hall Nov 02 '21 at 13:21
  • Office 64 bit or 32 bit version? Note that the 32 bit version has a 2 GB memory limit no matter how much RAM you have installed. On huge data files or extensive use of filters in Excel you might run into this 2 GB limit. Switch to 64 bit Office then. • Just in case the obligatory question *"did you turn it off and on again?"* (did you reboot and try again?). – Pᴇʜ Nov 02 '21 at 13:25
  • Yes, it's 64 bit and I've done a number of restarts. I've copied it onto a flash drive to try and run on my personal computer, and it seems to be running fine, so I'm not sure what's up. Probably something to do with the company computer... – Zeke Hall Nov 02 '21 at 14:11

0 Answers0