ActiveX Automation RefNum, Lost accross VI's

(Ref LV 5.1.1)
I'm using an Excel._Application RefNum to a Automation Open and then to a Property Node with method "Visible" set to False, the RefNum from the node is wired to a Global Automation RefNum.
The above code resides within a case of a multi case state machine.
Once the VI starts running, and the above case executes, Excel opens (in background).
Later, in a different state I wire the Global Refnum to a Property Node with method "Quit" and the Node wired to an Automation Close.
When this state executes, Excel closes BUT the error out of the Property Node indicates Code 1, invalid function.
Further expantion of the above to open a WorkBook, then a Sheet appears to succeed untill an attempt to write (or rea
d) a cell. Same error as above (1, invalid function)
Any ideas...
Thanks
Nicos

Hi Nicos,
You need to be careful to close all child Refnums in proper order. If you open Excel.Workbook.Range, then the ActiveX refnum for the "Range" must be closed first, then for "Workbook" and then you can close "Excel" properly. This can be annoying, but is very important.
If you are trying to close Excel without all child refnums closed, Excel will remain visible in the task manager. Have a look and see.
Hope this helps,
Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

Similar Messages

  • How do I quickly update the ActiveX automation references in my VIs when the ActiveX interface changes?

    Hello all,
    I joined a test automation team in the middle of a large project and
    inherited a huge set of VIs (over 700) and associated architecture for
    this automation (not to mention the several thousand TestStand
    sequences).  Another part of the project is being developed by our
    customer, who is using VB 6.0 to create ActiveX components which we
    need to use in LabView to access their hardware.  They've already
    invested a large amount of time developing these ActiveX components,
    and they are not finished -- meaning the ActiveX interfaces will be
    changing.  Every time they send updated ActiveX components, I have to
    re-write many, many VIs including updating a couple strict typdefs. 
    This process takes way too much time and is mind-numbing and prone to
    error or omission.
    Unfortunately I can't post any of the VIs because of a NDA.  But
    perhaps a bit more detailed explanation would help.  TestStand calls a
    VI to open and get an ActiveX reference for automation (which it stores
    in a variant).  It will pass this reference into any VI it calls to
    perform specific functions through this ActiveX interface.  For
    example, one VI that may be called passes this automation refnum into
    another, which passes it to another, which passes it into another to
    get the actual ActiveX reference stored in that variant (through a
    Variant To Data call with a strict typedef of the ActiveX component
    wired to the type input).  [See the attached image of this sample VI
    hierarchy: the far left icon would represent TestStand, and the far
    right is the strict typedef.]  Any of the VIs in the chain might use
    ActiveX Property or Invoke nodes, and it can break at any one of those
    when the ActiveX component changes.  It's easy to fix each one, but
    since there are so many VIs it takes a very long time.
    Is there any way at all to do a massive search/replace or something to
    make the ActiveX references update?  I realise that even though
    property or method names stay the same from one version to the next,
    they are different references.  Is there a way to update these based on
    name if you give it the base ActiveX reference?
    Thanks in advance for any help!
    Tom Williams
    Attachments:
    hierarchy.GIF ‏6 KB

    Ben,
    Unfortunately I can't post any VIs that would demonstrate the problem
    because the ActiveX components are confidential.  I'll try to develop
    my own ActiveX dll that will demonstrate it, but in the meantime, in
    hopes that another picture will help, I've attached an image of a block
    diagram (with some names changed to protect confidential information)
    of one of the lower level VIs from the hierarchy I posted.  In this
    example, the "Automation Refnum IN" is an input with a type definition
    linked to the strict typedef based on the ActiveX automation dll that
    has changed.  I updated that typedef, but as you can see the output to
    the "Class1" indicator is broken.  If I delete the "Class1" indicator
    and select Create->Indicator from the Class1 property node, and then
    wire the new "Class1" indicator to the connector pane, the VI is fixed
    -- at least at compile time.  In most cases there is also a runtime
    problem where the reference obtained by one of the intermediate
    property nodes is null, so the property or method node that uses it
    fails (e.g. "_VNManager.Networks" property returned is 0, so the
    "_Networks.Network1" property node fails).  To fix this problem, I have
    to delete the wires between the property nodes, and one by one select a
    different property/method, then select the correct property/method and
    re-wire.  There seems to be a bit of "jiggling the handle" to get it to
    work though.
    I don't know if the ActiveX developer changed anything in this class,
    but if he did, he didn't change the name of this class.  I would like
    to have to modify the VI only if a class, property or method has
    changed name or been removed.
    Does that all make sense?  Thanks for any pointers or help!
    Tom
    Attachments:
    Class1_Path.GIF ‏7 KB

  • Problem with Excel automation refnum

    While presenting ActiveX functions to students, I ran into an unexpected problem : only half of the PCs were able to work with Excel after the initial basic steps :
    place an automation refnum on the front panel
    right-click the automation refnum, then select ActiveX class, then select browse
    find Microsoft Excel objects library and select application
    connect an Automation open function
    etc...
    What happened is that an error 3005 (Automation Open: Object specified is not creatable in ... ) was generated on half the machines, while everything was running smoothly on the others.
    A workaround was to grab a working automation refnum control from the examples shipped with LabVIEW. The icon appears different and has a black arrow instead of the purple one got from the refnums palette. But even with this refnum, the problem could be reproduced when the activeX class was changed forth and back !
    All the systems (Windows XP- LV 8.2) and machines were identical, configured initially from the same disk image.
    Do you an idea of what's going on there ? Do you know where I  can get the black-arrowed automation refnum ?
    Message Edité par chilly charly le 12-08-2006 05:32 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Example_BD.png ‏3 KB

    Bump...
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • ActiveX Automation Reference getting corrupted when sharing with Teststand

    I am using ActiveX Automation to interact with a 3rd Party Software. I use LabVIEW Functional Global to store the activeX reference. I have some low-level APIs with the Automation Refnum In and Out and few high level APIs which use the reference from Functional Global. I am also using these APIs in Teststand. When I store the Automation Reference in the Teststand Local Variable and pass it to the low-level APIs, It was working fine. But when I pass the Reference from the Teststand Local Variable to the Functional Global and use it afterwards, the reference is getting corrupted and I am getting error.
    I have created a prototype of the situation using ActiveX call to Skype from LabVIEW. The attached file has 3 Teststand sequences explaining the situation. 
    Debug1.seq : Passes the reference from TS Local to LV Functional Global  : Generates error
    Debug2.seq : Uses the reference from TS Local alone : No error
    Debug3.seq : Uses the reference from LV Functional Global alone : No error
    Can anyone suggest why is the reference loses its validity or any solutions?

    Hello, Nandini,
    I am using the WinXP and I am calling the DLL provided by Pirouette for their chemometrics software. I just solved the error -2147467262, but the new error comes out is :
    Error code: -2147467259 Exception occured in IxAsObjs.CoSIMCAPredict.1, Language Server QueryInterface failed: No such interface supported.
    Here is a few word for the problem from priouette:
    " just a few more words that might help you understand the nature of the problem. your LabView client talks to AlgSuite.dll using IDispatch interfaces AlgSuite.dll communicates with the language server on an IUnknown interface.
    Your client knows nothing about the internal workings of AlgSuite.AlgSuite communicating with objects that do not have IDispatch interfaces should be irrelevant to your client."
    Since the VB demo works fine in my machine, so they though it is percular to labview. Any comments? I appreciate it.
    LvvL

  • Error when passing automation refnum to teststand variable

    Hi All
    I am trying to pass an automation refnum to teststand. However when i run the sequence i get the following error in the teststand variable watch i setup after the vi has run.
     Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
    The Automation open is calling an activeX which is configured to use DCOM for remote operation.
    I pass the refnum as an indicator from the vi and then use a function to set the local variable in teststand.
    I have also tried using the Teststand set property.vi but this will not accept the refnum as an input value even though i set the type to 'object'.
    Thanks in advance for any help with this.

    Hi George,
    I have configured DCOM as per the Article, and disabled all firewalls but i still get the error. Attached is a set of screen shots that's shows the labview function does not error but in teststand it does.
    I can also see from the Task Manager on the remote instrument that the function opens an instance of the application therefore suggesting that the DCOM is configured correctly.
    Regards
    Daz
    Message Edited by Daz37 on 10-19-2009 03:51 AM
    Attachments:
    VSA_REF_Error.doc ‏119 KB

  • Problems using automation refnum

    Dear All
    I am using a USB IO device called a "Phidget" this uses ActiveX.
    I have a single VI which has 3 different cases depending on what I want to do with my IO device, either Open, Carry out IO or Close. My problem is that when using the "Automation Open" vi the "AutomatioN Refnum" generated only seems to be valid during that particular execution of theVI.
    For instance say I run my vi to Open my device (and store the refnum to a local variable for later use), then later on I run my vi again to perform IO, the original automation refnum is no longer valid. I have read that this is because labview automatically closes the refnum when the vi has executed but the solution wasnt clear.
    I really want to avoid running this vi in a loop because it handles the Open, IO and Close operations for a number of different IO devices I have in my system and my architecture menas I need to be able to use the same vi to selectivley open, close or perform IO on a given device at will.
    Any help to get round this much appreciated.
    thanks
    ATE Man

    Hi ATEMan,
    you can store your reference in a shift register of a loop if you use a loop you can do in the existing, if you don´t use a loop you can use an action engine (global functional variable).
    Hope it helps.
    Mike

  • Getting hWnd from Automation Refnum

    Hi folks,
    My Labview application has an OCX as part of its front panel. The OCX display format is toggled by double-clicking on it. I want to be able to make this toggle from the LV app so I thought to use a 'Call Library Function Node' to PostMessage a double-click to the OCX control. A bit clumsy, I know, but it seems the only way to communicate to the OCX.
    My question is can I get the OCX's hWnd from its automation refnum? btw I am using Labview 7.0.
    Thanks, K.D.Giles

    OCX is an ActiveX object.  In LabVIEW, you use an ActiveX container to hold ActiveX object.
    The ActiveX container is a child window of the front panel window; the ActiveX object window is a child window of ActiveX container, ie. a grandchild window of the front panel window.
    You can use FindWindowEx to find the top, the child, and the grand child window.
    I don't if you can get the hWnd from automation refnum, unless there is a propety from the OCX.
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • LabVIEW Run Time Engine and ActiveX Automation Server

    Hi,
    I have a question related to LabVIEW Run Time Engine and ActiveX Automation Server:
    We have a tool developed in LabVIEW and TestStand. End user interface is a LabVIEW GUI (it's an executable) which executes TestStand sequences. Some TestStand sequences call lower level LabVIEW VIs.
    Everything works fine with LabVIEW installed, but I was wondering if I could run this tool on deployment machine with only LabVIEW run time engine installed. We are using LabVIEW 6.1 and with only the run time engine installed, I get the error message: "Unable to launch the 'LabVIEW.Application' ActiveX automation server ". 
    BTW, we are planning to upgrade the versions soon.
    Is it possible to make things work only with the run time engine?
    Thank you.

    Thanks for the response, Brian.
    I did upgrade to LabVIEW 8.0 and TestStand 3.5. Everything works fine on the development computer where LabVIEW and TestStand is installed. On the target computer in the lab, I installed LV RTE 8.0 and TestStand 3.5, and now when a VI is called in a sequence file, I get the following:
    RunState.PreviousStep.Result.Error.Code  -18002 
    RunState.PreviousStep.Result.Error.Msg  "LabVIEW: The VI is not executable"
    So, the executable opens and works fine (which means that the LV RTE is installed properly), but when a sequence calls a low level VI, it does not make it through.
    comments/suggestions are appreciated. Thanks.

  • Select Active X Class for Automation Refnum

    Using TS2010 SP1, LV2010.
    I'm building my own UI based on a mix between the simple and full featured UI examples.
    I'm creating a Globals front panel.  I place an Automation Refnum on the front panel and right click, I want to choose one of the managers (Application Manager)  I expect to see TSUI.IApplicationMgr, or TSUI.IExecutionViewMgr, but those are not part of the list available.  So I use the "Browse" selection and get a gigantic list of what I think are class libraries to choose from.  I've been through many of the TestStand and NI and zNationalInstruments choices but can not find where the TestStand Managers reside.
    While we are at it where do the other controls reside?  I'll need them later.
    Thanks in advance,
    Solved!
    Go to Solution.

    If you instaled TestStand after LabVIEW then you should see them show up on the palettes:
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Attachments:
    LabVIEWTestStandPalette.png ‏25 KB

  • ActiveX Automation server error on deployed TestStand

    I'm trying to deploy TestSTand 2.0 + LabVIEW 6.1 on a PC under Win-2K.
    I created and deployed TS Engine and Operator Interface for LV.
    I try to deploy the "Auto.seq" test from the TS exemples.
    Of course, it works on my Development system.
    On the deployed system, I got an error : -18351; An error occurred reading an ActiveX Automation server type library.
    Step 'Read Database Option - Construct' of sequence 'Get Database Options' in 'SequentialModel.seq'
    Step 'Read Database Option - Read Options' of sequence 'Get Database Options' in 'SequentialModel.seq'
    After having ignored those 2 errors, the tests goes on normally and the report looks fine.
    I also get this error opening the database configuration:
    Step 'Read Database Option - Construct' of sequence 'Edit Database Options' in 'Database.seq'
    From answers already given for similar subjects, I've checked that TsDBOptions.dll is present and registered (done regsvr32...) on the PC.
    Can someone help ?
    Note: upgrading to more recent TS + LV versions is not a solution!

    Whether you are using database logging or not, you should not get an error like that when database options are loaded. From the kb's you specified it sounds like there was an issue with a COM/ActiveX server not getting registered in the past. Especially on machines in which TestStand was installed from a deployment rather than the main installer. Have you tried running the version switcher like the KB suggested? Did it succeed or give an error? If it gave an error what was the error? Could you perhaps try a fresh install of TestStand on a clean machine?
    -Doug

  • Error -214746726​2 "No such interface supported" when open an ActiveX automation reference to proprietar​y DLL, why?

    I got the error -2147467262 "No such interface supported" when open an ActiveX automation reference to a proprietary DLL. I check the forum which suggested solutions related to comcat.dll and IE6.0. I also tried to re-reqister the dll by regsvr32.exe, still does not work. However, I did nto get any luck. I was told that the DLL support iDispatch interface and should work ok with ActiveX in labview. Any suggestions? I appreciate it.

    Hello, Nandini,
    I am using the WinXP and I am calling the DLL provided by Pirouette for their chemometrics software. I just solved the error -2147467262, but the new error comes out is :
    Error code: -2147467259 Exception occured in IxAsObjs.CoSIMCAPredict.1, Language Server QueryInterface failed: No such interface supported.
    Here is a few word for the problem from priouette:
    " just a few more words that might help you understand the nature of the problem. your LabView client talks to AlgSuite.dll using IDispatch interfaces AlgSuite.dll communicates with the language server on an IUnknown interface.
    Your client knows nothing about the internal workings of AlgSuite.AlgSuite communicating with objects that do not have IDispatch interfaces should be irrelevant to your client."
    Since the VB demo works fine in my machine, so they though it is percular to labview. Any comments? I appreciate it.
    LvvL

  • ActiveX Automation Server Error -18351

    I wrote a program using TestStand Version 4.5.1 and ran into this error code as soon as I initialize it.
    Error loading type library/DLL.
    Error Code: -18351; An error occurred reading an ActiveX Automation server type libarary Step 'Read Database Otion - Construct' of sequence 'Get Database Options' in 'SequentialModel.seq'
    Bottom line, I'm not using or planning to use any form of database with my program. I just want it to run.
    There was another document with ID 4IE7CCM6 that addressed this issue. Tried it, didn't help. I also went to the related links referring to the Knowledgebase document with ID 1HBAMMSR, didn't help either.
    How do I fix this?
    Attachments:
    errors_activeX.docx ‏200 KB
    errors_activeX.docx ‏200 KB

    Whether you are using database logging or not, you should not get an error like that when database options are loaded. From the kb's you specified it sounds like there was an issue with a COM/ActiveX server not getting registered in the past. Especially on machines in which TestStand was installed from a deployment rather than the main installer. Have you tried running the version switcher like the KB suggested? Did it succeed or give an error? If it gave an error what was the error? Could you perhaps try a fresh install of TestStand on a clean machine?
    -Doug

  • ActiveX automation server return "Error Win32"

    Has anybody meet this problem: I click on the' ActiveX automation server'
    in the CVI project window 'Tools' menu (CVI5.01) and then it starts to
    scan all the registered components but after a while it returns an error
    message like "Error Win32" so I can't work with the ActiveX components,
    I tryed uninstall and reinstall the CVI and the problem remains the same.
    The OS is Win NT 4.0

    Whether you are using database logging or not, you should not get an error like that when database options are loaded. From the kb's you specified it sounds like there was an issue with a COM/ActiveX server not getting registered in the past. Especially on machines in which TestStand was installed from a deployment rather than the main installer. Have you tried running the version switcher like the KB suggested? Did it succeed or give an error? If it gave an error what was the error? Could you perhaps try a fresh install of TestStand on a clean machine?
    -Doug

  • LV5 as ActiveX automation server

    Hello,
    I hope that somebody here is able to help me. I have a question about using
    LabView 5 as ActiveX automation server. This works fine for me when I build
    an C++ application based on the examples I got with LabView. But all
    examples I found make use of MFC.
    Now I have a C application that is based on pure Win32 API. My question: How
    can I implement calls to LabView-automation server using Win32 API without
    MFC?
    Thanks for your help in advance!
    Martin Schellenberger.

    Whether you are using database logging or not, you should not get an error like that when database options are loaded. From the kb's you specified it sounds like there was an issue with a COM/ActiveX server not getting registered in the past. Especially on machines in which TestStand was installed from a deployment rather than the main installer. Have you tried running the version switcher like the KB suggested? Did it succeed or give an error? If it gave an error what was the error? Could you perhaps try a fresh install of TestStand on a clean machine?
    -Doug

  • Excel automation refnum

    Hi all
    sorry for this stupid answer, but i'm just beginner in LabVIEW...
    I need to open and then to use  data from excel file in my calculus
    I read that it possible with automation refnum, but I can't do it
    Anybody could show me example how I can connect my excel file with automation refnum?
    Attachments:
    Testo.xls ‏8 KB

    hi citra,
    Actually I dont know your requirement.... But try this...
    Try 1
    Try2
    <<Kudos are welcome>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

Maybe you are looking for

  • Preload an image before JWindow appears

    is this accomplished with a thread? threads are the one territory im afraid to wander in, haha. I have a JWindow that is opening with only one image in it. However, as it is now the JWindow coems up immediately and there it is a LONG time before the

  • My battery still won't hold a charge. Can't Apple get me a new iphone under warranty?

    I have an iphone 4S. With no apps running it will die in six hours on standby. I've tried everything on the support page, rebooting, restarting, reloading the software, and it makes absolutely no difference. I've been to the Genius bar and they just

  • Populate Drop down values to Adobe forms

    Hello, I am in the process of developing the HCM forms for PCR's. This is using old technology. How can I pass values to the Adobe forms based on certain condition selected in previous screen. For eg. Based on Position selected, I should have a certa

  • Batch exporting pixel dimensions

    i want to export pixel dimensions from many images to text files in a batch process. the information can be exported as a metadata template from file info (camera data 2), but i have been unable to record the necessary actions. when i try to record t

  • Is it safe to delete system caches?

    Hello, Lately my computer is running a bit slow. So i looked up some tips to seed up my mac. I read i had to check my system caches and if the folder was over 3GB, I had to delete it. So I went and got my system caches folder, i saw the file size was