I ran into this a few weeks ago on a couple of computers - the
following fixed the issue for us...
1) The Mac may have/have had a 'demo' copy of microsoft office on it.
Trash the Microsoft Office Test Drive folder from the Applications
folder.
2) Restart
3) Reinstall Office
4) Put app in Office 2004->Office folder
5) Try again.
Another thing we ran into is having variables go out of scope - no
explanation here. But OLE seems to be 'sensitive' to connections.
Since myDoc is global ( or property of window/class) also make the
MSWord global as well. That way it doesn't have to get created it
every time the method executes.
Sub Start_Word
if MSWord = nil then MSWord = new WordApplication 'MSWord is
Global
if myDoc = nil then myDoc = new WordDocument
wrdApp.Visible = True
myDoc = MSword.Documents.Add <<===== Gets an OLEException
myDoc.Activate
exception err as oleexception
msgbox err.message
End Sub
- Jay
On Apr 20, 2006, at 11:28 PM, Peter E. Barck wrote:
Hi,
I have built a small Office Automation Module with a variety of
Methods to start up MS Word and insert text from Editfields. All
this works fine when running from a small test app with one Window,
several Editfields and a Pushbutton with a call to start word
After copying this module to my main application, and moving
this application into the
Microsoft Office 2004/Office folder if fails to open Word. I have
the following simple code:
Sub Start_Word
Dim MSword As WordApplication
MSword = New WordApplication
myDoc = MSword.Documents.Add <<===== Gets an OLEException
exception err as oleexception
msgbox err.message
End Sub
myDoc is globally defined as WordDocument
The main application talks to a REALSQLServer and a local
REALSQLdatabase. Has no timers nor Threads. No other ole objects; 4
windows with mostly Editfields, Listboxes, Popups and Checkboxes.
So, what could interfere with starting up MSword. How do I go
about debugging this? I tried to open Word before anything else
happens by calling "Start_Word" in the App Open event. Gets me the
same OLEException error.
Any help or hint is greatly appreciated!
--
Cheers,
Peter
TI PowerBook G4, 1GHz, 1GB RAM, OSX 10.3.9, RB2006r2 Pro
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>