Jump to content

Excel 97 and ActiveX

Recommended Posts

I'm struggling to get Excel97 working with ActiveX. Excel2000-2003 works fine, but Excel97 just won't work. I've read all the forums and articles about issues with Excel and ActiveX and tried the solutions I found. I would just like to know if anyone have used Excel97 (Microsoft Excel 8.0 Object Library Version 1.2) and ActiveX, and if so, how did you get it working?

A simple thing like doing like this picture below will give an error 3005 on one PC (at automation Open), practically random errors (!) on another (At the property node), and "the server threw an exception" on a third PC (at the property node). A few properties actually work when I don't get error 3005, like "_Application.Caption".


I've tried a fresh install of WindowsXP with LV 8.2.1, LV6.1 and Excel97. Updated to Office SR-1, but that doesn't help. Then I tried to update to SR-2. SR-2 install will fail claiming my Excel-version is of base level, althoug SR-1 says it has updated Office97 if I run it again. The SR-2 logfile says Excel.exe is of Office base version. I Also tried all this on Win2000. I guess it's possible my original Excel97 is corrupt somehow, but I haven't found another copy of it.

If you have used Excel97 and ActiveX-automation, please let med know what system setup and Excel97-version you have or how you got it working.

If you have any idea of what could be wrong, please share your guess.

If you can think of another way of inserting data into different sheets to Excel97 and formatting the cells , please let me know. Excel97 doesn't seem to support either xml or .net.

Link to post
Share on other sites


I have done some work in the past to automate Excel using VB. The CreateObject and GetObject functions are roughly equivalent to the Automation Open vi that you are using. As I recall, Excel was one of the first applications to offer automation on a broad level with Excel 97 representing a version or two into the process. However, I found it to be somewhat finicky in how it is to be used. I don't have 97 installed on any machines to directly test this out, but you could try a few things.

First, I would run excel and then try to attach to the running copy by using the "open new instance" input to the vi and see if your commands work.

Second, I would try to set the visible property to true after creating the application object. By default, excel is created with the visible property set to false. I have found odd or unpredictable behavior when automating an invisible instance of excel. Go figure.

With the visible thing in mind, if you have problems or crashes, you might want to do your debugging with the windows task manager visible. You may have a need to manually kill an excel instance from time to time if they are not automatically cleaned up.

Good luck


Link to post
Share on other sites

Thanks for the reply. My begging for help made you a member, YES!

Since the Visble property returned an error I haven't tried to set it to True, but now I did and I could see that although the properties return errors, some properties still do what they should. Others don't :wacko: . I have tried to bypass all bad functions and still do what I need, but there seem to be too few working functions.

The other tips you gave are good, I already use them.

If I find a solution I will post it, but I'm leaning towards convincing my customer that its cheaper to upgrade msOffice.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.