Skip to main content
Participating Frequently
June 3, 2008
Question

CreateObject() with ID CS2 broken in Vista (VBA)?

  • June 3, 2008
  • 14 replies
  • 1941 views
I posted earlier under a fairly ambiguous subject, so I am re-trying here--forgive the dual post, please...

but I think I have narrowed it down. It appears to be a problem with InDesign CS2 and Vista. I can't get any application to call CreateObject successfully without an "Out of memory" error on the call: even from the command line using .vbs.

Does ANYONE have any idea what's going on? Or any ideas? Ole, you out there?

Thanks,

jdb
This topic has been closed for replies.

14 replies

Known Participant
June 4, 2008
Hi Joel,

To start with, I think the out of memory error is bogus. It's most likely that something else is wrong, and that InDesign is just tossing that error out as its best guess.

Next, for a short term solution, you could take the opposite approach: right now, your VBA runs in Excel and contacts InDesign; you could, instead, create a VBScript that you run in InDesign that then creates an Excel object and does its work there.

We're hearing reports of similar problems from other Vista users--you can see some in this forum. I haven't really been able to track it down, because I'm still mostly running XP, and because the only Vista I have is a VMWare virtual machine (where everything seems to work). I don't have the newest Mac OS release, either--there's just too much work to get done to go through a system update!

Thanks,

Ole
Participating Frequently
June 4, 2008
UPDATE:

I have modified the permissions on the folders in the path to "Resources for Visual Basic.tlb" (in the C:\ProgramData folder). No joy. Still get an out of memory error.

I did try running a sample script to create an InDesign Object and then open a file, display the filename and then close the file, then quit InDesign. It worked as a .vbs under the Scripts folder from within InDesign.

I don't know why I can't script this from a VBA host, though. If at all possible, I would rather not re-do the script as it is designed to run from within Excel, pulling data from numerous sheets, charts, etc.

UPDATE#2:

I even tried to create an object from Ruby using WIN32OLE. Here is the message I got:

C:\Users\Joel\Documents>ruby test.rb
test.rb:49:in `initialize': failed to create WIN32OLE object from `indesign.application' (WIN32OLERuntimeError)
HRESULT error code:0x8007000e
Not enough storage is available to complete this operation. from test.rb:49:in `new'
from test.rb:49

Here's the call in Ruby: indesign = WIN32OLE.new("indesign.application")

Not enough storage? Same as out of memory? Maybe this error code will help? Any more ideas?

Thanks for your help!

jdb
Participating Frequently
June 4, 2008
Thanks, Ole -- yes, I added the reference to the project. I'll check the other two and get back with you. On a side note, I even tried to run it from a C# .net application and got the same out of memory error.

Thanks,

jdb
Known Participant
June 3, 2008
Hi Joel,

Several questions:

Have you added a reference to the InDesign object library in your VBA macro? (I forget to do this every time I update Office--sometimes it carries over; sometimes it doesn't.)

Can you run .vbs scripts from the InDesign Scripts panel?

Do you have read/write permissions on all of the folders in the path to the "Resources for Visual Basic.tlb" file (you'll probably have to search for it--lots of places it could be in Vista).

Thanks,

Ole