Results 1 to 1 of 1

Thread: VB - Solving problems with Excel/Office Objects

  1. #1

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Smile VB - Solving problems with Excel/Office Objects

    My VB6 application references the MS Office and Excel Object Libraries to create reports. To save time, I have three excel sheets that I use as templates, and this system has always worked fine.

    However, I've recently upgraded my development PC from Office '97 to 2003, and whereas I was using the Office and Excel 8 OLs, I'm now referencing the version 11 OLs, simply because that's what's installed.

    Of course, everything still worked fine on the Office 2003 PC, but when I ran the updated version of the app on machines with previous versions of office installed the whole app crashed at the point where it tried to open one of the template xls files (not, to my surprise, where it created the excel object.)

    Seemed to me that there was a backward-compatibility thing going on here. Question was, did I need to compile my code on a PC that has Office 97 on it, or was there some other way round this?

    Well, I did my usual bit of ill-advised tinkering and came up with a sort of solution...

    I installed VB6 on my old 98se machine with Office 97 on it. Copied the project across and opened it, and of course it complained about not being able to reference Excel 11 or something... so I pointed it at Excel 8 and Office 10 that were in the available list, ran it and it worked fine - no crash. So my little brain got to thinking...

    Copied the Excel 8 and Office 10 files (excel.exe and mso.dll) across from that machine into a new folder on my Office 2003 machine, opened the project and chose those files directly instead of the normally available Excel/Office 11 ones. Compiled the project and tested the exe on the Office 97 machine - and it works.
    Last edited by coox; Sep 21st, 2005 at 05:26 AM.
    Nick Cook
    VB6 (SP6)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width