Help !!!

jyotsnasjyotsnas Member Posts: 62
edited 2002-11-20 in Navision Attain
Hi all

Posting for the first time - hope to get reply as soon as possible.

i am working on a codeunit that is supposed to read from and wrirte to an Excel file. Simple .. right !!!
:)

i have office 97 installed on my machine - so included Microsoft Excel 8.0 Object Library as source of Automation object.

my friend, who has office 2000 installed on his machine - imported this codeunit. tried to execute and hooooooo Got an error for it couldnt find the Excel8.0 object library.

:twisted: that was irritating

then i changed the source to Excel 9.0 Object Library. it worked fine then.
but still - is there any way to avoid changing sources everytime u encounter different version of Office ???

Help me to get through this folks
______Doubt is the father of Invension_______

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    jyotsnas wrote:

    then i changed the source to Excel 9.0 Object Library. it worked fine then.
    but still - is there any way to avoid changing sources everytime u encounter different version of Office ???

    No there isn't. You'll have to create one codeunit with your automation code for each Excel Object Library version.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • jyotsnasjyotsnas Member Posts: 62
    Thanks for an instant reply

    if i got it right , u mean to say that i'll have to create a separate codeunit for each version of Excel Object Library.

    if i got it right , i have one more thing to ask :?
    suppose these codeunits are gonna reside on server, then each of them will be called according to the version of Office the client is using. How can i predict the version that client is using.

    the question may seem stupid - but i think as a newcomer i have liberty to ask it - :oops:
    ______Doubt is the father of Invension_______
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can't use Automation to check the version, as it depends on the version ;-)

    Or you add a field to the user table, where you keep track of the installed Office version. Or maybe you can look at the dll-file installed on the client PC, to determine the version (look at length of file, or inside the dll).
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • jyotsnasjyotsnas Member Posts: 62
    Thanks again for a quick answer.

    :idea: i tried out this option just now. i created my own DLL that uses this EXCEL object library ( 8.0 on my machine ).
    when i registered this DLL on my friend's machine, it worked :D
    it may be checking for excel versions on its own. but again, i'll have to register it on every client machine manually.

    what do u say about it ???
    :?
    Do u have any idea how i can check for installed versions of the Office ?

    Hope to get assistance from u.
    Thank You
    ______Doubt is the father of Invension_______
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Create a form with the wizard, and use table 2000000046 Automation Servers (select Tabular-Type form). When you do a preview, you see all the automation objects installed, including version no. In your code, you can do a FIND in this table to determine if Office is installed, and what version.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • jyotsnasjyotsnas Member Posts: 62
    Thanks a lot !!! :D
    ______Doubt is the father of Invension_______
Sign In or Register to comment.