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

Similar Messages

  • 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...        

  • Excel Automation Closing

    Hello,
    I have developed a VI (based on ActiveX) that writes to a spreadsheet with some formatting. Past posts on this forum were very helpful in getting me at this point and Kudos to members who have posted VIs, LLBs, and created a thread just for Excel automation.
    I've one question related to Excel application closing:
    Currently, I am doing a clean close of all references in my VI for report generation using ActiveX. If I am viewing any open workbooks in excel when my VI is running then it closes all open xls/xlsx files when the "Excel Automation Close" is executed.
    My question is: Is it possible to somehow not close instance of Excel application that was not created/opened through LabVIEW?
    Thanks.

    Hello,
    Using the System Exec VI, I am able to get the Process ID of Excel application instance. However, to use the workbook node, Application refnum is required.
    Is there a way to get to the Application refnum using the process ID?
    For now, I have figured out a way to avoid any Excel workbook closing with Automation close. Wiring True to Open New Instance in Open Automation seems to do the trick.
    Thanks.

  • 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)

  • Excel Automation in C# - Excel process won´t quit

    Hi there,
    I´m using Excel automation with C#. When closing Excel, the Excel.exe process still remains in the Task Manager. I´ve tried all the topics that can be found, but Excel won´t quit. When I make Excel visible and close it myself, then the process will stop.
    But when I call the Quit() method, it keeps running.
    Here is my code:
    Excel.Application oExcel = new Excel.Application();
    oExcel.Visible = true;
    Excel.Workbooks oWorkbooks = oExcel.Workbooks;
    string Pfad = "C:\test.xlsx";
    Excel.Workbook oWorkbook = oWorkbooks.Open(Pfad);
    Excel.Worksheet oSheet = oWorkbook.Sheets[1];
    oSheet.Cells[1, 1] = "Test";
    oSheet.SaveAs("C:\test.xlsx");
    GC.Collect();
    GC.WaitForPendingFinalizers();
    Marshal.FinalReleaseComObject(oSheet);
    oWorkbook.Close();
    Marshal.FinalReleaseComObject(oWorkbook);
    oExcel.Workbooks.Close();
    Marshal.FinalReleaseComObject(oWorkbooks);
    oExcel.Application.Quit();
    Marshal.FinalReleaseComObject(oExcel);
    oExcel = null;
    Thanks for any help!

    Sorry I didn't catch the problem sooner.  No need to do any of the marshal stuff or the releases.  they are not necessary.  when you modify the workbook excel won't normally close without the user being prompted if they want to save changes. 
    So simply end you code like this
    If you don't want to save changes
    boolean savechanges = false;
    oWorkbook.Close(savechanges, Type.Missing, Type.Missing);
                    oWorkbook = null;
                    oExcel.Quit();                
                    oExcel
    = null;
    Or this if yo do want to save changes
    boolean savechanges = true;
    oWorkbook.Close(savechanges, Type.Missing, Type.Missing);
                    oWorkbook = null;
                    oExcel.Quit();                
                    oExcel
    = null;
    jdweng

  • 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

  • Excel automation

    Hello,
    I am trying to use the ActiveX Excel Automation server.  I have gotten TestStand to run the excel application, however, when I try to create a new workbook I get the following error:
    "Create New Object" in automation call failed.
    Class not registered
    One possible reason for this error is that the server might be an in-process 64-bit COM server. TestStand is a 32-bit process and Windows does not allow a mixture of 32-bit and 64-bit code within the same process. TestStand can create objects from an out-of-process 64-bit COM server directly, but for in-process 64-bit COM servers you must create the object in an external 64-bit process and pass it into TestStand using an out-of-process server or a DLLSurrogate.
    I have attached the sequence file I have been using.
    Solved!
    Go to Solution.
    Attachments:
    Excel Test.seq ‏6 KB

    Hello mcooblal,
    I took a look at your sequence file and you are not correctly accessing the workbook class. First you need to get a reference to the workbooks property which returns a reference to the workbooks property. Then using the workbooks reference you can then get the workbooks class which has a method for adding workbooks.
    Here is a good sequence example that references these steps:
    http://zone.ni.com/devzone/cda/epd/p/id/5318
    Ian M.
    National Instruments

  • 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

  • Create a default path into Automation Refnum

    I'm currently writing an app which should display a nice graph (chart) on
    its front panel. I choose to use Mapinfo Active X.
    To do this, I've placed an Automation Refnum on my front panel, and in the window
    'select object form Type Library', I choose "Mapinfo.tlb" .
    It works quite well, but :
    When I re-open this Vi, I should re-setting the Automation refnum. I try to use Active X container, it doesn't work. Can I create a default path into the Automation Refnum or any other method which can solve this problem.
    Thanks for your help.

    You shouldn't select the type lybrary, in automation refnum, when you want to select te type, available types appear if properly registered in your system, if not, you should register your tlb.
    Hope this helps

  • Excel Automation with Interop - Windows Service - Microsoft Excel cannot access the file

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file:
    Unhandled exception Occured : 'Microsoft Excel cannot access the file 'bla.xls'. There are several possible reasons:
    The file name or path does not exist.
    The file is being used by another program.
    The workbook you are trying to save has the same name as a currently open workbook.'.'
    The code snippet used to open the file:
    xlApp = new Application();xlApp.Visible = false;xlApp.UserControl = false;xlApp.Application.ScreenUpdating = false;xlApp.DisplayAlerts = false;xlWorkbook = xlApp.Workbooks.Open( Filename: filePath,  UpdateLinks: 2,  IgnoreReadOnlyRecommended: true, Editable: false);
    The console app and windows service are running on a Win Server 2008 64-bit OS with Excel 2013 32-bit installed. The service is running with a special user account, which has all the right permissions on accessed files and folders. The excel process is also
    started with the same account (I cheched that one). 
    I already tried to do the following, but to no avail:
    Run excel.exe /automation -> worked fine
    Created the folders and also gave full control to the account under which the service is run (even gave full control to Everyone)
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    C:\Windows\System32\config\systemprofile\Desktop
    Configured DCOM
    Excel Application -> Identity -> Specific user account
    Excel Application -> Identity -> Interactive User
    Excel Application -> Security -> Launch permissions -> Everyone full control
    Several combinations of the above
    So I really am stuck with this problem right now. Any input on this is appreciated.

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file
    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office
    may exhibit unstable behavior and/or deadlock when Office is run in this environment.
    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side.
    If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
    You can read more about that in the
    Considerations for server-side Automation of Office article.

  • Excel close refnum order

    Hello,
    I'm trying to use read/write to an Excel file and I'm rather new to activex.  Based on an example program, I can read the contents of the sheet.  However, afterwards I can not open the file.
    From what I can find on the forums, this is a known problem with the order you close the refnums.  However, after alot of trial and error, I still can't seem to get it right.  Here's what I have at the moment..
    open applicaton
    open workbooks
    open workbook
    open sheets
    open sheet
    activate sheet
    get range refnum
    get value
    close range refnum
    close sheet refnum
    close sheets refnum
    close workbook refnum
    close workbooks refnum
    close application refnum.
    Any help would be greatly appreciated.  After I read the current data, I want to use another vi to write values.  Unfortunately, I can't do this when a refnum from the read VI is still open.
    Solved!
    Go to Solution.
    Attachments:
    Get Data from EXCEL.vi ‏30 KB

    Hi Pjr1121,
    nyc is right. use Quit Application, it will solve your issue.
    When you close Excel the way you are doing it, it will be still running. Check it in Task Manager>>Processes
    When you quit application then Excel is completely closed.
    All the best.
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Extract text from PDF and parse to Excel, automator? applescript?

    I'd been trying to do this with automator and have been getting nowhere. 
    I have some pdf files that have selectable, formatted text in them.
    Its an old college directory that I would like to import.  There are chunks of text:
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    etc.
    I'd like to find a way to extract the names, the phone numbers, and the hometowns and get it all into those respective columns in excel.  Seems that I don't stand a chance with automator.  Do I need a programmer for this?

    I'd been trying to do this with automator and have been getting nowhere. 
    I have some pdf files that have selectable, formatted text in them.
    Its an old college directory that I would like to import.  There are chunks of text:
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    Name:  XXX, XXX
    Telephone: (XXX) XXX-XXXX        DOB:    XX/XX/XX          Gender: XXX
    Hometown:
    dflasdkfjdlkj
    asdflajksdflj
    adsflakjdsf
    etc.
    I'd like to find a way to extract the names, the phone numbers, and the hometowns and get it all into those respective columns in excel.  Seems that I don't stand a chance with automator.  Do I need a programmer for this?

  • Activex Excel Automation: the Missing Handle

    Once upon a time there was a piece of legacy code, working well.  It would open Excel workbooks, add data, and make it look nice.
    Then one fateful day, the old code creaked and groaned, and it doesn't work the same way it used to when it was fresher and younger.
    Now when the code runs, an excel 2007 reference is not closed somewhere, causing the excel.exe process to remain open after the code has finished execution.
    With great care, I have extracted all the extraneous code from the process, so that only a few base functions remain; yet the problem persists!  For your convenience, I have flattened it all onto the same vi pane (the old code is rather modular)!  Apologies for any extraneous wire bends =)
    My questions are threefold:
    What changed that caused this code to stop working? 
    Is there a better way to find and close activex references than staring intently at the wires?
    Is there, dear reader, perhaps a blatent error in the old code?
    Attachments:
    Fun with references.png ‏59 KB

    I"ve moved all the CR's to the end of the VI.  The problem persists.  Look at the examples? Are you toying with me?
    Attachments:
    test.vi ‏16 KB

Maybe you are looking for