Using vlookup btwn worksheets when using ActiveX Excel

I am having problems using the vlookup function in Excel.  It works fine if I have the lookup table on the same worksheet that's already open in LabVIEW.  I first open an excel file that I use as a template.  I copy the header and formula information from that file into an activeX container containing an Excel worksheet.  I then allow the analyst to enter data into the ActiveX Excel spreadsheet.  Meanwhile, I create a log template by creating a text file with headers.  When the analyst is done entering data on the front panel, they click on the Update/Print Label button.  This appends their data (a range of cells) to the text file (which is then formatted and saved using report generation tools) and it's printed to a label.  The problem is on the front panel ActiveX Excel sheet.  The original excel sheet used as a template has many formulas, all of which work well in Excel, as well as in the LabVIEW app, with one notable exception.  One of the cells contains a formula that uses a vlookup function.    The problem is when I place that lookup table on a different worksheet.  It works great if I place the lookup table on the same sheet as the template, but when I try to reference a different sheet, I get an error.  I'm assuming that I just need to add code to open the second Excel spreadsheet (or better yet - a separate workBOOK).  I was confused at first, because the vlookup function worked fine in Excel, but not in LabVIEW.  Then I realized that Excel already had all the worksheets in the workbook open, but LabVIEW does not.  Am I correct?  If I want to use a vlookup to look on another worksheet or another workbook, do I just have to open that second workbook/sheet in LabVIEW?

Hi Dan,
You are right.  LabVIEW does not have the other worksheets open.  I think that you are on the right track.  I recommend opening another worksheet and testing it out.  LabVIEW should stop giving you an error when you do.
Nick Keel
Applications Engineering
National Instruments 
Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments

Similar Messages

  • Missing worksheet when opening in EXCEL 2013

    Hi,
    I had an output from our existing ERP system with file type as XLS.
    Currently, if open in EXCEL 2010, I am able to view the workbook with multiple sheet.
    However, now, in EXCEL 2013, I cannot geth the same result. I get only to view 1 sheet with 1 sheet missing from the open workbook.
    Why is this happeneing? No problem in EXCEL 2010.
    Please assist.
    Bye

    Hi,
    If this is not a SharePoint related issue, I would suggest you open a thread in the corresponding forum, you will get more help and confirmed answers there.
    Thanks 
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Error code "-21468272​84" when trying to open an Excel workbook using ActiveX

    Hi all,
    i have a problem using ActiveX to open excel files. I get error code "-2146827284" (unknown error) when trying to open a workbook. This problem occurs on only one machine i work with, on the others it works fine. All machines have the same setup, Excel97 and Excel2007 installed on them.
    Any ideas??
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    ExcelToolkit open.PNG ‏53 KB
    ExcelToolkit open FP.PNG ‏32 KB

    andyforpresident wrote:
    For sure the file is there, the _application object gets created without an error.
    Creation of the application object has nothing to do with opening the workbook, which is what is generating the error. If you are getting an error with opening the workbook then you either have the wrong path, a permissions issue, a network issue, or the file is already open.

  • How can I add excel pictures using activex

    I would like to be able to use activex to insert an image into an excel spreadsheet. I know how to read and write data, but the chart feature is too cunmbersome and when I updated excel to 2007 most of the calls stopped working. I see that there is a pictures property/method that lets me specify an image file, but I don't know which property/method(s) to call it from.

    2007 does take more time to draw the data on the chart. I am not having any problems with errors on the active X for 2007. I is much slower than 2003 I would agree. My IT group moved us to 2007 so I am stuck with it no matter how slow it is. I am trying to figure out how to get the help file back. I had these in 2003 myself. I know it has nothing to do with LabVIEW. It is an add in or some switch that you need to throw in excel to allow for this connection.
    Tim
    Johnson Controls
    Holland Michigan

  • Writing to Excel using ActiveX improvement?

    Hello,
    At my company we have Labview 2011 basic version with DAQmx. I am writing a program to get temperature data from thermocouples (16), dump it in an array and then store it in Excel using ActiveX. ActiveX seems only to allow writing element by element to my spreadsheet.  When you do acquisition for a long period of time it can be very long! I like using ActiveX because it allows some flexibility such as choosing which sheet and cell I can write my data. Is there a solution to dump the array in one operation using ActiveX?
    I know there is a block call write to spreadsheet which accept 1D and 2D array of data but doesn't allow the same flexibility. I also found report generation but is it made to write data? While waiting for your answer I'll try to dig a little more that blockset.
    Thank you very much and I hope to hear from the community really soon.
    Regards

    I have to appologize. The solution given by Electromecha was good but only outside a loop. Again, I have 16 thermocouples and when I use Electromecha's solution inside a For loop it will copy only the first element. I attached two pictures. One is the program and the second is the result in the spreadsheet. You will notice that inside my loop I added an indicator to read the array before writing it in Excel. The indicator shows the array perfectly with all elements in it. The only way I found to work around this issue is to use indexing and write element by element in Excel. That is way too long!
    For your information, the loop itteration is defined using the array size which is 16 (for 16 thermocouples). The subvi inside the loop allows me to get the column letter from the itteration number. Finally using the size of one full array of results I get the end cell row. 
    If more explanation is required please let me know. 
    Many thanks!
    Attachments:
    Excel.JPG ‏89 KB
    Program.JPG ‏69 KB

  • Creating a table in Excel using ActiveX functions

    Hi,
    I am new to labview and have have a project where i need to create tables in labview using activeX, i cannot seem to get the Invoke node Table (under range) to work, any help would be much appreciated.

    This question is not related to LV at all. So in general, this question is more for MSDN (Microsoft Developer Network).
    That being said, here the steps you have to implement in LV:
    Open Automation Server Excel._Application
    Set property Visible to true (otherwise, you won't see the result unless you save the workbook)
    Create a Workbool
    In the Workbook, create a Worksheet (that's what you call a "table")
    That's it.
    Norbert
    PS: Due to "reference lifetime", you want to keep the VI running (e.g. event based waiting for a button press) otherwise Excel will shutdown as soon as you release the reference to Excel._Application.

  • How to use ActiveX Microsoft Office Excel Chart?

    Does anyone know how to use "ActiveX Microsoft Office Excel Chart" from CVI 7.0? I tried with following code but it did not draw anything.
    HRESULT MakeChartInExcelActivexCtrl(void)
    HRESULT error = 0;
    char szErrMsg[256];
    // Create a new chart with its own worksheet
    // ExcelRpt_ChartNew(workbookHandle,-1,&chartsheetHandle);
    SetWaitCursor (1);
    // Open new Range for Worksheet
    error = CA_VariantSetCString (&MyCellRangeV, EXCEL_ARRAY_OF_CELLS);
    error = Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyCellRangeV, CA_DEFAULT_VAL, &ExcelRangeHandle);
    CA_VariantClear(&MyCellRangeV);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    error = Excel_GetProperty (excelChart, NULL, Excel_WindowActiveChart, CAVT_OBJHANDLE, &ExcelChartHandle);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Create a XY scatter chart using the data we wrote to the worksheet as its data source.
    error = ExcelRpt_ChartWizard(ExcelChartHandle, ExcelWorksheetHandle, EXCEL_ARRAY_OF_CELLS,
    ExRConst_GalleryXYScatter, ExRConst_Columns, 0, 0, 0, 0, "Filtered Data Chart", "",
    "Weather Data", NULL);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Change the plot lines to not display markers and smooth out
    // the plot lines. This is one of the plot styles available in Excel.
    error = ExcelRpt_SetChartAttribute (ExcelChartHandle, ER_CH_ATTR_CHART_TYPE, ExRConst_XYScatterSmoothNoMarkers);
    if (error<0)
    CA_GetAutomationErrorString(status, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    Error:
    SetWaitCursor (0);
    CA_VariantClear(&MyCellRangeV);
    CA_VariantClear(&MyVariant);
    ClearObjHandle (&ExcelRangeHandle);
    ClearObjHandle (&ExcelChartHandle);
    ClearObjHandle (&ExcelChartObjHandle);
    ClearObjHandle (&ExcelChartsHandle);
    if (error < 0)
    ReportAppAutomationError (error);
    return 0;
    Attachments:
    excelActivexCtrl.zip ‏4692 KB

    I use C:\Program Files\National Instruments\CVI90\toolslib\activex\excel\excelreport.fp to  build/modify excel report.there is very detail configuration in this function moudule , hope it can help you 
    Sonic
    Diffrent Strokes for Different Folks

  • I am using Activex controls from Labview to log the data into Excel spreadshee​t. My applica

    tion is running fine without giving any error messages. But even after the vi stops, excel process does not shutdown. "Excel.exe" process keeps running until I end it from Windows NT Task Manager. Is there any way to end the excel.exe process from Labview?

    tion is running fine without giving any error messages. But even after the vi stops, excel process does not shutdown. "Excel.exe" process keeps running until I end it from Windows NT Task Manager. Is there any way to end the excel.exe process from Labview?I use Excel Active X control frequently to save and then analysis test data. In order to properly destroy the "Excel.exe" process it is important to close all the automation refnums opened when using the Excel active x controls. After completing your desired Excel task wire all the refnums in reverse order they were created into the Automation Close function in Functions->Communication->Active X pallette. This includes all Application, Workbook, Worksheet, or Range refnum. Missing even one of these refnums will mean that Excel.exe will still persist in the task manager and cause problems when excel is opened from outside LabVIEW. I hope this helps.
    Stephan

  • Excel operation using activex

    I am trying to use activex with labview to copy a specific worksheet from a multi-sheet excel file to another spreadsheet file. How can I do this? Any example vi? All my example files are about making a copy within the same file.
    Yin

    Yin,
    You can use the VI from the following web site
    Writing Rows to Excel 97 and Excel 2000 Using ActiveX
    The VI allows you to write to a specific worksheet. You can use some of the SubVIs provided to first get a reference to the worksheet in the first workbook, for example SelectSheet and OpenSheet VIs.
    Or you can look into LabVIEW shipping examples on Excel, Write Table to XL VI, which also allows you to open specific Worksheet.
    Some good examples on how to read from Excel using Activex are located on these web sites:
    Reading Values from Microsoft Excel 97, Excel 2000, or Excel XP Worksheets
    Write and Read to an Excel 2000 Spreadsheet via ActiveX
    Zvezdana S.
    National Instruments

  • Efficiency of using activeX for Excel

    I've been using data logging for our test fixtures in .tsv files, but our engineers want to automate it further by organizing some new data into several sheets, so I'm looking into manipulating Excel directly using ActiveX.
    My question is how efficient is it to write this in ActiveX compared to just making a text file? I'm concerned that, since we're going to be writing some 50000 cells or something, that it'll suck up a lot of memory to do it through ActiveX. 
    Is this a legitimate concern, or am I just being paranoid?
    Anything worth doing is worth over-doing.
    LabVIEW Junkie

    Thanks for all the help, guys! 
    A couple of things -- first off, I'd love to look at that code if you get a chance. But what I'm concerned about is if I create an array of 50000 values or something like that and write it all in one go at the end of the program, two things are going to happen: 1) it's going to take a really long time to finish the program, and 2) if the program crashes in that final step, I'll lose all the data. That second reason is why I currently write a line every cycle to the .tsv file. 
    What I'm thinking of doing, is meeting you halfway -- rather than write each cell individually, write each line individually within the spreadsheet. This should reduce the memory used (hopefully) and increase performance.
    I haven't really played around with TDMS yet, I'll look into it. A couple questions on that -- does it write in excel format? The reason I ask is the second sheet that I'm supposed to add is not going to contain any changing data -- it's just to store some constants that are set on the front panel. If TDMS stores data in excel format, I can write it to TDMS, transfer to Excel, and then use ActiveX to add the second worksheet with the constants at the end of the program. How's that sound?
    Thanks again!
    Anything worth doing is worth over-doing.
    LabVIEW Junkie

  • Header of ALV with space when exported to excel using Standard ALV

    Hi,
    I am Using Reuse alv grid display    to dispaly my report and it works fine and I am using the standard SAP application tool to export it to excel.
    But for some of the header fields I am getting space in the excel sheet but there is no space while displaying through ALV.
    I am using the following field catalog for the same.
    wa_fieldcat-col_pos = 10.
      wa_fieldcat-fieldname = 'SOLLWERT'.
      wa_fieldcat-seltext_l  = 'text-t10'.      "Target value (* this has no space here)
      wa_fieldcat-outputlen = 32.
    wa_fieldcat-colwidth_optimize = 'X'.
      APPEND wa_fieldcat to it_fieldcat.
    but there are still space for this Colomn when exported to excel if after optimizing the column.
    kindly suggest what field needs to be passed to the field catalogoe to avoid spaces in excel for the header.
    Thanks
    Ritesh

    hey all,
    Thanks everyone for the reply.
    I am using the foloowing field cat:
    l_col_pos = l_col_pos + 1.
        wa_fieldcat-col_pos = l_col_pos.
        wa_fieldcat-outputlen = 32.            
         wa_fieldcat-fieldname = 'SOLLWERT'.
         wa_fieldcat-inttype   = 'P'.             
    *    wa_fieldcat-tabname = 'i_final'.      
        wa_fieldcat-seltext_l = text-t11.         "Target Value
        APPEND wa_fieldcat TO i_fieldcat.
        CLEAR wa_fieldcat.
    I have use this also in the field cat but stil i get space in the excel header.
    wa_fieldcat-REF_FIELDNAME = 'SOLLWERT'.
    *    wa_fieldcat-REF_TABNAME =  'QAMV'.
    Also the space comes with the descrip[tion in the cell of excel.
    its like [space Target Value] and i dont need this Space.
    I have also used  wa_layout-colwidth_optimize = 'X'. but it doesnt wrk.
    Please suggest

  • Reports output delayed when exported to Excel using OLE2

    Hi All,
    Platform - Oracle Application Server 10g Release 2 10.1.2.3 on Windows 32 bit.
    The report output is getting generated in a minute when exported to PDF i.e destype=cache & desformat=pdf. When we generate the output to excel is considerably delayed. It is taking time and internal server error is occuring.
    1) Report developed with simple query
    2) Used RPT2XLS procedure which uses OLE2 builtin to export report output into excel.
    3) Called RPT2XLS.run procedure in After-Report trigger of the report.
    4) We have relased all memory objects in the RPT2XLS package after exporting data and there is no EXCEL.exe running once the file is generated.
    System parameters used in the URL.
    . destype=file
    desformat=pdf
    CONTAINSOLE=yes (Required for exporting OLE2 objects into Excel in report)
    desname=path & name of the file.
    I have gone through the tuning documents for reports server and increased minengine, maxengine and initengine parameters of the reports engine and also changed maxconnect and IdleTimeout parameters in reports server configuration file.
    What might be the reason for delaying in the output of the reports when exported to Excel. Can the guys with special knowledge on this area help us in getting out of this issue.
    Thanks in advance.

    hey all,
    Thanks everyone for the reply.
    I am using the foloowing field cat:
    l_col_pos = l_col_pos + 1.
        wa_fieldcat-col_pos = l_col_pos.
        wa_fieldcat-outputlen = 32.            
         wa_fieldcat-fieldname = 'SOLLWERT'.
         wa_fieldcat-inttype   = 'P'.             
    *    wa_fieldcat-tabname = 'i_final'.      
        wa_fieldcat-seltext_l = text-t11.         "Target Value
        APPEND wa_fieldcat TO i_fieldcat.
        CLEAR wa_fieldcat.
    I have use this also in the field cat but stil i get space in the excel header.
    wa_fieldcat-REF_FIELDNAME = 'SOLLWERT'.
    *    wa_fieldcat-REF_TABNAME =  'QAMV'.
    Also the space comes with the descrip[tion in the cell of excel.
    its like [space Target Value] and i dont need this Space.
    I have also used  wa_layout-colwidth_optimize = 'X'. but it doesnt wrk.
    Please suggest

  • How to use ActiveX to open/write to Excel template but not to overwrite it

    Hi there again (it's me...if anyone recognised me...)
    I managed to use ActiveX to open Excel and make it visible onto the screen. But I would like to know how can I make Excel open an Excel template and let me write data to the cells without overwriting the original template. I did try to use another program source such as the EXCEL TOOLKIT but I can't still figure out how does it work for my case. Is there a simpler example for me to refer too? Please help.
    Thank you,
    juni

    Hi Mike..
    I have tried to use the examples provided LabView 6.0. I don't understand how to use the Range value to get the data from my global array and also how to open the template and write data to it.
    At the moment, I could only open a saved dialog box and a default string filename is used to save my data into a new Excel but not the formatted excel which I want.
    If possible, please help again. Vi attached.
    Attachments:
    savefile.vi ‏109 KB
    datarecords.vi ‏12 KB

  • When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    When printing in Excel It is always want to use the acrobat X pro trial, which the trial is expired. I do not want to use acrobat X pro trial anymore. How can I reset it and use simple acrobat to print my PDF document?

    Hi screen name,
    Adobe PDF printer gets installed when you install Acrobat 10 Pro.
    To use this printer you need to purchase Acrobat. Once the trial period is over you cannot use the printer to create pdf files.
    An alternative way for you is to utilize Microsoft's own inbuilt pdf engine.
    You can simply open the file and select 'Save as' and in the type list select 'pdf'
    Please refer : http://office.microsoft.com/en-in/excel-help/save-as-pdf-HA010354239.aspx
    Regards,
    Rave

  • Use of Excel Addin when MDS is using https

    We have set up MDS with a secure connection using https and a certificate for SSL connection, bound to the default site for MDS. When we try and use the Excel addin, it throws an error : Could not establish trust relationship for the SSL/TLS secure channel
    with authority {server root address}
    Can anyone help?

    Does web ui works from the same machine excel is running?
    When you connect to the WebUI, the browser will show a smart icon in the address bar for certificate. If you open it, does it say the certificate is valid?
    1. The certificate should be valid. If it is self signed certificate, you need add this certificate to Trusted Root.
    https://technet.microsoft.com/en-us/library/cc754841.aspx
    2. The certificate name should match the service name.
    If the webUI works on that machine without any warning in browser, the excel addin should work with the exact same server url.

Maybe you are looking for

  • Mac Mini 2010 OS X Lion Stalled WiFi Connetion

    I have a 2010 Mac Mini that has been upgraded to 10.7 from 10.6. It is fully patched. I've been experiencing dropped or stalled wifi connections where the system still shows 100% signal from the Airport Extreme Base Station. My base station has the 5

  • Preserving Black when Exporting from InDesign to PDF

    Hi All: I hope  someone who knows Acrobat can help me with this. I have an InDesign file  that I must export to PDF. That in itself isn't the problem. This is: The  text in InDesign is solid black (000000), but once it exports to PDF,  it collects a

  • ESS - New Window

    We have enabled launching HCM F&P by calling the ASR_PROCESS_EXECUTE Application in an iview When we open a Form, and click on the Role Tab, instead of opening in the same window, system is opening a new window. If we open a WDA screen / WD Java scre

  • How can i call java class file in jsp page

    Hai, i wants to call .class file in jsp page. my class file is in C:\jsdk\bin. Thanks

  • Adobe premiere CC freezes when editing large files

    Hello Recently i had a project editing a one shot movie. Its a 11min movie, shot ot Canon 5D mark II ( 3.7 gb  MOV file ) When i imported it in Premiere, i had so much problems. Anything i did, program freezed for 30s aprox. Im not talking about some