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

Similar Messages

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

  • Xy graph in excel using activeX

    Hi
    I am trying to plot a XY graph in excel using Active X. I have two coloums of data one should be X the other should be Y. I am using XlXYscattersmooth graph type and giving the range as A1 to B5. But when the excel plots it, I am getting two series rather of X data points rather than XY. I know I am doing a simple mistake in choosing some variable but I am not able to figure out where I am going wrong.
    Can anybody please look at my code and correct the code in order to get a XY plot rather than getting two different series.
    Thanking you in advance
    Nitin
    Attachments:
    excel4.vi ‏155 KB

    Hello
    Here is that Set Cell Value with Range.vi
    Regards,
    Nitin
    Attachments:
    Set Cell Value with Range.vi ‏45 KB

  • How to save then quit excel using activeX

    The task that I need to do is open existing excel file, append data to the last row, save data then close it. Everything works fine except saving the data. I used property workbook note to save then invoke node to close a workbook then invoke node to quit excel application. I watched and see that the data is written to the sheet but when I closed it, it is not saved.
    System: Window NT and Excel2000
    Thank you

    mai wrote:
    >
    > The task that I need to do is open existing excel file, append data to
    > the last row, save data then close it. Everything works fine except
    > saving the data. I used property workbook note to save then invoke
    > node to close a workbook then invoke node to quit excel application.
    > I watched and see that the data is written to the sheet but when I
    > closed it, it is not saved.
    >
    > System: Window NT and Excel2000
    Use Task Manager to check if Excel is still running.
    I find that the programmatic close of Excel doesn't work. Excel is left
    running until you actually quit either LabVIEW or the built app!
    Side-effect: if you then launch Excel to view a document, the screen
    isn't redrawn right.
    Mark

  • How do I autosize columns in Excel using ActiveX in Labview

    I found the ExcelExamples.llb but nothing that describes this. My data is sometimes bigger than the default column width.
    thanks

    How about using a macro to run the column autosize function?
    I cheated, and recorded an autosize operation on a column, and then looked at the vb code behind the macro...
    Columns("D").EntireColumn.AutoFit
    should do the trick.
    In the excelexamples.llb, they seem to use macros to perform other functions, so maybe this is a way to achieve the autosize function that you require.
    Hope this helps...
    JB

  • 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

  • LabVIEW and Excel with ActiveX

    Hi,
    I am using LabVIEW6.1 and I am trying to format data for printout that I have stored in Excel using activeX.
    I have three questions that I included the recorded Excel macro for:
    1) How do I set the horizontal and vertical page breaks using ActiveX?
    Excel macro:
    Set ActiveSheet.VPageBreaks(1).Location = Range("F1")
    Set ActiveSheet.HPageBreaks(1).Location = Range("A41")
    2) How do I set the print area using activeX?
    Excel macro:
    ActiveSheet.PageSetup.PrintArea = "$A$1:$J$57"
    3) How do I left, right center justify the content of cell using ActiveX.
    Excel macro:
    Range("B3:B8").Select
    With Selection
    .HorizontalAlignment = xlCenter
    End With
    Thanks in advance for your time.
    KMA

    You cannot index the VPageBreaks if you are creating a new worksheet. You would use the index to change an existing VPageBreak. To create a new VPageBreak, replace the Item method with the Add method. Wire the range ref directly into the Before input. I fixed your VI and attached it.
    To get the value of the xlCenter constant, open the Visual Basic editor that comes with Excel and use the Object Browser (F2). Type xlcenter into the search window and click the binoculars. The value is displayed at the bottom of the window. You will use that trick a lot when looking for the Excel constants for LabVIEW.
    Michael
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector
    Attachments:
    Excel_Page_Break_mod.vi ‏67 KB

  • How to write data which i am reading from spectrum in excel using Report Generation toolkit.

    Hello All,
     I wrote code for reading data from Spectrum analyzer and also for writing in excel using report generation toolkit. When i run program values get read and excel sheet opens also but i cant see anything written in it.
    So if anyone can help me in this i will be very gald. I am attaching screenshot of my program and also attaching .vi file. As i am using drivers you can see some of vi.
    Thanking You,
    Pallavi 
    Solved!
    Go to Solution.
    Attachments:
    Channel_Power.jpg ‏123 KB
    Channel Power_Toolkit.vi ‏64 KB

    Hi Palavi,
    you try to select a specific worksheet what is not existing, therefore just select "Channel Power" (and not Power Channel) and it should work for you.
    Regards,
    Tobias

  • 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

  • Problem with writing continuous data to excel using using Report Generation vi's

    Hey Everyone,
    I am trying to read the data from DAQ and write to excel continuously using Report Generation vi's. 
    But when I run the VI, it writes only one interation of the while loop (gathering data from DAQ continuously) and doesn't append the data into the same file when I run it again after stoping the VI. 
    I have attached the VI i created. Please let me know if you have any idea to solve this issue. 
    Thanks
    Attachments:
    sample 5.vi ‏35 KB

    There are two problems with your VI.  First, the basic logic of writing/appending to a file (Excel, TDMS, anything) should go something like this:  Open the file, position yourself at the end of the file, then, in the loop, acquire data and write it to the file until you are finished with data acquisition.  When you exit the acquire/write to file loop, then close the file.  In particular, the opening and the closing of the file should not be inside the loop.
    As others have pointed out, writing to Excel might not be optimal, particularly if you are acquiring data at a high rate (and would therefore be writing a lot of data). We actually use Excel in our data acquisition routine, mainly reading from a WorkSheet to get the parameters of a particular stimulus, but also writing the outcome of the response to the stimulus.  As it happens, our "acquisition rate" in this example is on the order of several samples per minute, so there's no problem using Excel (we also sample 16 channels of analog data at 1 KHz -- this gets written as a binary file).
    Second, if you really do want to use Excel, use the (existing) Excel file to which you want to append as the "template" argument of the New Report function.  Then use the Excel Get Last Row function to position yourself at "end of file", as noted above.
    Good Luck.
    Bob Schor

  • 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 into Excel file using PL/SQL and formatting the excel file

    Hi,
    I am writing into a excel file using PL/SQL and I want to make the first line bold on the excel. Also let me know if there are any other formatting options when writing into excel.
    Regards,
    -Anand

    I am writing into a excel file using PL/SQL
    Re: CSV into Oracle and Oracle into CSV
    check that thread or search in this forum...

  • 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

  • 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

  • Problem using ActiveX for excel app to determine row/col no.s

    hello,
    I would like to develop an app, which would find out the total no. of rows and columns from a given excel sheet and read out the data in the same. I have made use of few vi's I found on forum, but having trouble runing them,
    can anyone please suggest me what could I be doing wrong? I have never used activex before...
    Now on LabVIEW 10.0 on Win7
    Solved!
    Go to Solution.
    Attachments:
    excel used range.vi ‏25 KB
    test.vi ‏19 KB
    read_excel_values.llb ‏382 KB

    Hi
    Yesterday I sent an email to a guy, explaining how to install it. Download the toolkit and the instructions I have attached and you should be fine.
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway
    Attachments:
    _Excel.zip ‏1393 KB
    Howto Install Excel Toolkit.pdf ‏1270 KB

Maybe you are looking for

  • 10.1.3 Pro: How to get the selectedItem in a selectOneChoice?

    I have a selectOneChoice component on the JSP. It has a list of IDs from 1 to 100 and 19 is skipped (... 17, 18, 20, 21...). I tried the following code to get the real value of the selectedId. FacesContext fc = FacesContext.getCurrentInstance(); Valu

  • Service Station does not start automatically

    Good morning, recently the Toshiba Service Station application does not start when Windows (8.1) starts. If I launch the application manually, it runs normally. I would like to restore the automatic start of that application. What can I do?

  • JdbcOdbc crashes

    I'm developing an data extraction software with Jdk 1.6.03. I use various odbc driver. Some drivers are very primitive. With older drivers odbc (french database engin drivers, like Hyper File or OpenCriteria), JVM crashes after an hour or less. The p

  • Something's wrong...Design View issue....

    OK. I'm attempting to take an Excel purchase order form and turn it into an HTML form for a custom demo that I will be performing tomorrow.  The nature of the demo isn't important; what is important is that I have no choice but to use Design View, as

  • Quantum TV - Skip Ahead does not work when program still recording or when time shifting

    I've always used skip ahead (set to 30 secs) to jump over commercials etc.  Since "upgrading" to Quantum, the skip ahead button does not always work.  I've narrowed the problem down to when the show you're watching is still airing (i.e. not  done rec