Error re OLE & References
I posted a query regarding an error described below.
It was suggested by another to check the Excel & Word VBA references for any
that were missing. The blank instances of each were fine but trying to check
for my Excel/Word app is difficult as the client is long distance and I don't
want to give them the password to unlock it. So I sent an unlocked copy of
the app with code removed. My Office version is 2003 and theirs XP or 2002.
When the client installed my app in the right directory it showed all the
proper references, correctly showing MS Excel 10.0 Object Library and MS
Office 10.0 Office Object Library. But it shows MS Word 11.0 Object Library
(what was in the app send from my Office 2003 system) as Missing.
Any ideas if that is clue to the problem or what it could be?
Would the steps I took above be adequate to check the references or do I
need to do it another way?
Again, any help appreciated. Thanks and God bless
> I have an Excel VBA application that links to a Word template using
> automation and the Find-Replace method to populate the latter. I have run it
> without problem in all MS operating systems and Microsoft Office versions.
> However trying to run it on a customers Dell Latitude laptop it produced the
> following error populating and printing the Word template: "Microsoft Excel
> is waiting for another application to complete and OLE application". The
> error message pops up after successfully printing the 2nd page regardless of
> the total number of pages to be printed.The application referred to is
> apparently the winword.exe but no such process seems to be running. Clicking
> on "ok" closes the message display then re-displays it and nothing else can
> be done until ctrl-alt-del is hit to shut it down.
> The Latitude is Pentium RM processor 1600 Mhz with 512 RAM with Windows XP
> Pro SP 1 and Office 2002/XP SP2.
> What I don't understand is why it is giving an OLE error message for this
> version of Office as I thought OLE referred to automation for earlier
> versions of Office which KB articles on that message also seem to indicate.
> For now I don't have access to debug the code as the client is long distance.
> Any ideas what is going on? Any and all help greatly appreciated.
> Thanks and God bless
The problem here is, as you suspect, that the client's PC has an earlier version of Word, and you've hard-coded a reference to a later version.
The best approach when developing for multiple versions of Office is to develop on a PC with the EARLIEST version of Office you want to support.
You'll have to decide what your best approach is; if you have a PC with Office 2002 available to you, you could load the app in that, manually set the references to Office/Word 10.0, save/lock the app, then send it to the client. Failing that, you'll have to somehow re-set the references on the Client's PC, either by talking them through it over the phone, or by connecting to their PC and controlling it over the Internet via PC Anywhere or VNC or Windows XP's Remote Assistance, etc. This approach is probably the best, as you can avoid giving the Client the password. In fact, you may want to require all your users to have some form of "Remote Control" software, as I do - it makes remotely debugging your apps SO much easier.
The only other option is to re-write the app using Late Binding - essentially, instead of setting a Reference and using code like this:
you declare your variable as an Object, like this:
Dim Wrd As Word.Application
Dim objApp As Object
Set objApp = CreateObject("Word.Application")
There are 2 main disadvantages to this approach: first, it is much slower than setting a Reference (aka Early Binding). Second, you won't get IntelliSense popping up to list the parameters of functions etc.
Also, as I said above, this will require a re-write of your code.
Good luck and HTH,
Thanks for your reply and your suggestions.
I appreciate it.
No Problem, Van.
I hope it helped, and that you were able to fix the problem.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center