Excel and Macro with Labview

Hello every body,
I have to read to excels files int order to treat them and generate graphs ( 3 graphes) in another excel file. to do that, i want to use the Macro for Excel.
How can i do, I want to write my basics codes VBA even in Labview.
Tks for your help

It also requires the Office Report Generation Toolkit.....
So maybe i shorten this and tell you that the toolkit includes a VI called "Excel Run Macro.vi". Within this VI, an ActiveX call is done to the Excel Application class called "Run" taking many optional arguments.
So working with ActiveX to interface with Excel will give you the needed toolsuite.
Please refer to msdn.microsoft.com for specific help on Microsoft products (like Excel). You can use this link for an easier start.
hope this helps,
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.

Similar Messages

  • How can I create a new excel workbook only with labview

    Hi everyone...
    I'm trying to create a new excel workbook only with labview but I can't find the file in the hard disk.
    Someone knows?
    Labview 8,0
    Attachments:
    Create new WB with LV.vi ‏18 KB

    You are not using the correct mechanism. Pull up the Example Finder in LabVIEW, click on the "Search" tab, and enter "Excel". Look for an example called "Write Table to XL". Use this as a starting point for creating new workbooks and adding data to it.
    Note: on disk the example is at <LabVIEW install directory>\examples\comm\ExcelExamples.llb.
    Message Edited by smercurio_fc on 06-05-2007 11:08 AM

  • When calling Excel 97 Macro from Labview 5.1, get error: cant find macro!

    I have a macro written that I am trying to call from Labview. To assist in this task I downloaded an Excel Macro VI off the NI Websight. The VI came with an excel workbook that included a sample macro. I can run the example with no problems. I then modified the VI to fit what I am trying to do. I can get it to work with the Sample excel macro but not the one I created (I get an error saying it can't find the Macro). I have played with the timing and that has not worked. I have also noticed that when I use the sample Macro, it will work fine for a while then after a random number of executions, it will stop working and I will get the same error as with my Macro. In order to get it working ag
    ain, I have to remove the sample worksheet (macro) and replace it with the original copy. I have been pulling my hair out for a couple of days now with this one so any help would be greatly appreciated!

    I am not sure what the problem could be. The VI you speak of can be found at the following link:
    http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/190d1f351297ef9a862567740073e2bc?OpenDocument
    I ran the program for excel 2000 on my LabVIEW 6.1 about 50 times and did not get the error you reported. Your macro should not be corrupted with use. Have you considered reinstalling excel? I liked the idea about turning off multithreading. Do you see the same behavior if you run in high light execution mode?
    Jeremy Braden
    National Instruments

  • Excel and macro

    Hello Everybody
    I hope somebody can help me with the next problem.
    I created a excel's macro that connects via ODBC a one table of Oracle(Oracle 9.2.0.1.0). When I execute this macro within excel, this works fine, but when I try execute this macro through a form (forms9i) at moment in that excel opens appear a screen that requests me that I select a ODBC connection and once that I selected the connection the macro shows an error (1004 error of the ODBC). all this happens of side of server.
    the code of this form is te next:
    PROCEDURE macroexcel IS
    application OLE2.obj_type;
    workbooks OLE2.obj_type;
    workbook OLE2.obj_type;
    worksheets OLE2.obj_type;
    worksheet OLE2.obj_type;
    cell OLE2.obj_type;
    args OLE2.list_type;
    mac OLE2.obj_type;
    name_file varchar2(12) := to_char(sysdate);
    local_cursor_record number:=:system.cursor_record;
    old_cursor_style VARCHAR2(200);
    errors_occured boolean:=false;
    ole_error exception;
    pragma exception_init(ole_error, -305500);
    PROCEDURE OPEN_EXCEL IS
    BEGIN
    application := OLE2.CREATE_OBJ('Excel.Application');
    OLE2.SET_PROPERTY(application,'Visible','True');
    Workbooks := OLE2.GET_OBJ_PROPERTY(application,'Workbooks');
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args,'D:\excel_rh\macroxls.xls');
    workbook := OLE2.GET_OBJ_PROPERTY(workbooks,'Open',args);
    OLE2.DESTROY_ARGLIST(args);
    end open_excel;
    PROCEDURE OPEN_SHEET IS
    BEGIN
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args,'respaldo');
    worksheets := OLE2.GET_OBJ_PROPERTY(workbook,'Worksheets');
    worksheet := OLE2.GET_OBJ_PROPERTY(workbook,'Worksheets',args);
    OLE2.DESTROY_ARGLIST(args);
    END OPEN_SHEET;
    PROCEDURE MACRO IS
    BEGIN
         args := OLE2.CREATE_ARGLIST;
         OLE2.ADD_ARG(args,'rcons');
         OLE2.invoke(application,'Run',args);
         OLE2.DESTROY_ARGLIST(args);
    END MACRO;
    procedure place_value_in_cell(rownum_in in number,colnum_in in number,value_in in varchar2) is
    args OLE2.list_type;
    BEGIN
    args:=OLE2.create_arglist;
    OLE2.add_arg(args,rownum_in);
    OLE2.add_arg(args,colnum_in);
    --cell:=OLE2.invoke_obj(worksheet,'Cells',args);
    cell:=OLE2.get_obj_property(worksheet,'Cells',args);
    OLE2.destroy_arglist(args);
    OLE2.set_property(cell,'Value',value_in);
    OLE2.release_obj(cell);
    end place_value_in_cell;
    PROCEDURE SAVE_SPREADSHEET IS
    BEGIN
         select to_char(sysdate,'hh24miss')
         into :global.name_file
         from dual;
    args := OLE2.create_arglist;
    OLE2.add_arg(args,'D:\excel_rh\resp_sijag'||to_char(:resp_sijag.f_resp,'ddmmyyyy')||:global.name_file||'.xls');
    OLE2.invoke(worksheet,'SaveAs',args);
    OLE2.destroy_arglist(args);
    OLE2.invoke(application,'Quit');
    END SAVE_SPREADSHEET;
    BEGIN
    Begin
         old_cursor_style:=get_application_property(cursor_style);
         set_application_property(cursor_style,'BUSY');
         open_excel;
         OPEN_SHEET;
    macro;
    exception
         when form_trigger_failure then
         raise;
         when ole_error then
         message('error sending data to excel');
         message(' ');
         errors_occured:=true;
         raise form_trigger_failure;
    end;
    save_spreadsheet;
    OLE2.release_obj(worksheet);
    OLE2.release_obj(worksheets);
    OLE2.release_obj(workbook);
    OLE2.release_obj(workbooks);
    OLE2.release_obj(application);
    if not errors_occured then
         go_record(local_cursor_record);
    end if;
    set_application_property(cursor_style,old_cursor_style);
    web.show_document('http://dcaoagsijag01.dca.ad.pemex.com:8888/forms90/excel_rh/resp_sijag'||to_char(:resp_sijag.f_resp,'ddmmyyyy')||:global.name_file||'.xls');
    END;
    I don't understand what happen with this application or maybe I'm forgetting put something in my code, for that this macro works fine
    Thanks in advance
    Regards

    If anyone wants to help him, here is his code made much more readable.
    Hello Everybody
    I hope somebody can help me with the next problem.
    I created a excel's macro that connects via ODBC a one table of Oracle(Oracle 9.2.0.1.0). When I execute this macro within excel, this works fine, but when I try execute this macro through a form (forms9i) at moment in that excel opens appear a screen that requests me that I select a ODBC connection and once that I selected the connection the macro shows an error (1004 error of the ODBC). all this happens of side of server.
    the code of this form is te next:
    PROCEDURE macroexcel IS
    application OLE2.obj_type;
    workbooks OLE2.obj_type;
    workbook OLE2.obj_type;
    worksheets OLE2.obj_type;
    worksheet OLE2.obj_type;
    cell OLE2.obj_type;
    args OLE2.list_type;
    mac OLE2.obj_type;
    name_file varchar2(12) := to_char(sysdate);
    local_cursor_record number:=:system.cursor_record;
    old_cursor_style VARCHAR2(200);
    errors_occured boolean:=false;
    ole_error exception;
    pragma exception_init(ole_error, -305500);
    PROCEDURE OPEN_EXCEL IS
    BEGIN
    application := OLE2.CREATE_OBJ('Excel.Application');
    OLE2.SET_PROPERTY(application,'Visible','True');
    Workbooks := OLE2.GET_OBJ_PROPERTY(application,'Workbooks');
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args,'D:\excel_rh\macroxls.xls');
    workbook := OLE2.GET_OBJ_PROPERTY(workbooks,'Open',args);
    OLE2.DESTROY_ARGLIST(args);
    end open_excel;
    PROCEDURE OPEN_SHEET IS
    BEGIN
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args,'respaldo');
    worksheets := OLE2.GET_OBJ_PROPERTY(workbook,'Worksheets');
    worksheet := OLE2.GET_OBJ_PROPERTY(workbook,'Worksheets',args);
    OLE2.DESTROY_ARGLIST(args);
    END OPEN_SHEET;
    PROCEDURE MACRO IS
    BEGIN
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args,'rcons');
    OLE2.invoke(application,'Run',args);
    OLE2.DESTROY_ARGLIST(args);
    END MACRO;
    procedure place_value_in_cell(rownum_in in number,colnum_in in number,value_in in varchar2) is
    args OLE2.list_type;
    BEGIN
    args:=OLE2.create_arglist;
    OLE2.add_arg(args,rownum_in);
    OLE2.add_arg(args,colnum_in);
    --cell:=OLE2.invoke_obj(worksheet,'Cells',args);
    cell:=OLE2.get_obj_property(worksheet,'Cells',args);
    OLE2.destroy_arglist(args);
    OLE2.set_property(cell,'Value',value_in);
    OLE2.release_obj(cell);
    end place_value_in_cell;
    PROCEDURE SAVE_SPREADSHEET IS
    BEGIN
    select to_char(sysdate,'hh24miss')
    into :global.name_file
    from dual;
    args := OLE2.create_arglist;
    OLE2.add_arg(args,'D:\excel_rh\resp_sijag'||to_char(:resp_sijag.f_resp,'ddmmyyyy')||:global.name_file||'.xls');
    OLE2.invoke(worksheet,'SaveAs',args);
    OLE2.destroy_arglist(args);
    OLE2.invoke(application,'Quit');
    END SAVE_SPREADSHEET;
    BEGIN
    Begin
    old_cursor_style:=get_application_property(cursor_style);
    set_application_property(cursor_style,'BUSY');
    open_excel;
    OPEN_SHEET;
    macro;
    exception
    when form_trigger_failure then
    raise;
    when ole_error then
    message('error sending data to excel');
    message(' ');
    errors_occured:=true;
    raise form_trigger_failure;
    end;
    save_spreadsheet;
    OLE2.release_obj(worksheet);
    OLE2.release_obj(worksheets);
    OLE2.release_obj(workbook);
    OLE2.release_obj(workbooks);
    OLE2.release_obj(application);
    if not errors_occured then
    go_record(local_cursor_record);
    end if;
    set_application_property(cursor_style,old_cursor_style);
    web.show_document('http://dcaoagsijag01.dca.ad.pemex.com:8888/forms90/excel_rh/resp_sijag'||to_char(:resp_sijag.f_resp,'ddmmyyyy')||:global.name_file||'.xls');
    END;I don't understand what happen with this application or maybe I'm forgetting put something in my code, for that this macro works fine
    Thanks in advance
    Regards

  • File drag and drop with Labview 7 and Mac OS X Tiger?

    Hi folks,
    I've lost the ability to drag and drop files into front panel file path
    controls, since I upgraded to a new OS X version. Specifically:
    What used to work:
        - Labview 7.0
        - Mac OS X 10.3.x
        - drag file icon from desktop and drop onto file path control (file path control shows path to dropped file)
    New action taken:
        - lost old Mac (Titanium) with OS X 10.3.x
        - bought new Mac (Aluminum) with OS X 10.4
        - installed OS X 10.4 "over" 10.3 disk (did not build from scratch)
    What happens now (three days after birth of new system):
        - all my past Labview apps still seem to run
        - but, if I drag a file from the desktop and drop it onto the file path control I see:
              - file path control
    "outlines" indicating that it understands the intended drag and drop
    action
              - when the file is dropped the file path control does not report the new value
              - And the file path control still has it's old value
    Anyone else seeing this? Am I missing something obvious (Labview or OS X preferences)?
    Thanks in advance,
    RMP

    Hello,
    I don't know how seriously Apple sees the problem, but it doesn't seem plausible that they would rev the OS on account of just this problem with LabVIEW, particularly since we worked around it for the latest version of LabVIEW.  I understand you are working with another engineer at NI via direct email regarding this issue, and that is going to be a better forum for discussing the possibility of obtaining the Apple bug report number.  In the event R&D is willing to reveal it, I presume they will be more comfortable doing so on a case by case basis, as opposed to posting it on the external discussion forum.
    Thank you, and sorry for the inconvenience you have encountered due to this issue.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Where can I found hardware to get analog signal from VCR and work with labview and then sample this signal in very high frequency?

    I am trying to build a Digital Video Recorder using Labview. The problem is that I found that Labview sample the signal in the order of milisecond. I wanted it to be in the order of microseconds. Also I am looking for a cheap Hardware solution if it is possible

    Your question does not make a lot of sense to me, so I will just point out a few things.
    1. The PCI-1411 works well with VCR signals. It has a BNC connector as well as a S-Video connector. The price is under $1000, so it is fairly reasonable. The amount of time you save getting it to work with LabVIEW is worth any extra cost.
    2. The PCI-1411 is sampling three colors at 30 frames per second, with an image resolution of 640x480. This is the best resolution you are likely to get from a VCR signal. The sampling rate for each byte in the image is about 28 MB/sec. This is in the microsecond range that you are looking for, I think. If you are only interested in the raw signal instead of the image, you could look at the high speed digitizing boards NI sell
    s that acquire at higher rates.
    If this information isn't really what you were looking for, perhaps you could clarify your question.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Can I free download excell and word with mac

    I would like to download free excell and word. I can find many offer. Are there any risk to get VIRUS? Any suggested website?

    Hi,
    The above advice is sound.
    If you see free versions of Office or components like Word and Excel separately, then they are likely to be trouble.
    Mostly that are likely to include Malware, possibly Trojans but Viruses are are unlikely as there is no recorded Mac OS X virus in the wild (Anywhere outside Lab conditions).
    That is not to say that there will not be a Virus at some point and a free download is just the sort of vehicle those bad people will use.
    10:36 PM      Sunday; September 25, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to read columns of a Microsoft Excel .csv file with LabVIEW?

    This should be simple.  Any ideas on how to read an Excel file with csv extension using LabVIEW?
    Thanks!

    Use the Read From SpeadSheet File.VI which you can find on the FILE I/O pallette.
    "Read From Spreadsheet File
    Reads a specified number of lines
    or rows from a numeric text file beginning at a specified character offset and
    converts the data to a 2D, single-precision array of numbers. You optionally can transpose the
    array. The VI opens the file before reading from it and closes it afterwards.
    You can use this VI to read a spreadsheet file saved in text format. This VI
    calls the Spreadsheet String
    to Array function to convert the data."
    The CSV file is essentially a text file which uses commas as delimiters in the files structure.

  • How to update data to excel in runtime with LabVIEW Report Generation Toolkit

    hi,All
         i am using LabVIEW Report Generation Toolkit,and a newer.i want to insert the data in excel for every loop.
         so at first,need to creat a excel file(xxx).and when every loop end,the test data can be insert into the file(xxx).when the test finished,the file will be saved.
         i have seen the examples in LabVIEW Report Generation Toolkit, all of them need to creat a new file.i need update the data in the same file.
         can you give me some advances for that?
         my labview's version is 8.5 and LabVIEW Report Generation Toolkit's version is 1.1.0.
         thanks a lot.

    Hi cat099,
    One question, why don't you store data of each loop, say in shift register and update all data in excel  at once when your test is finished.
    It will be easy. Or else, if you want to build same functionality as you mentioned, then you can build your own vi to write in excel. No need to use report generation toolkit.
    See attached example.
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.
    Attachments:
    write to excel.vi ‏21 KB

  • Control DC Motor (start and stop) with LabView

    I never used Lab View before. For a project, we have to use Lab View to make a small dc motor (HP:1/2, RPM 1725) start, and stop. I have no idea how to do this. Any advice/help anyone? Any tutorial or vi. would help!

    Hi there,
    Search for “H-bridge” for a common DC motor control circuit, the input terminals from the bridge can be controlled using any DAQ device with digital output lines from LabVIEW. For example: https://decibel.ni.com/content/docs/DOC-17062
    Regards,
    Alejandro | Academic Program Engineer | National Instruments

  • How to Control the Valves and Pump with Labview?

    I have started a new project where I have to control the valves operation through Labview 2009,using PXI 1031, NI 5105(Digitizer) and NI 6251(M-series DAQ).
    The valves I need to control using the labview are:
    a) Pressure Reducing Valve (open & close)
    b) Remote control Valve(On & Off) with in-built actuator
    c) Flow control valve(open, semi open, partially open, semi close, partially close, fully close), 1%, 2%, 3%..etc
    d)saftey valve (opening closing depending on increase in pressure from certian limit)
    I hav eto control
    a) Hydraulic pump operation with in built gear-box
    Please let me know, how should l develop the VI for all? How to get started?, any helpful links? If there is any example code?
    Its little urgent !

    If you are not familiar with LV, I would suggest you go through the tutorials. Then take the leap and figure out how to use Action Engines and State Machines (search any of the terms I used that don't understand, there are a zillion threads on them).
    Then...
    Sit down and write stand-alone testers for each of the widgets you are going to control monitor etc.
      These testers will give you an idea if they really work the way you think, their character, and will serve as a "Sanity Check" when you think you are going crazy  durring development.
    THen integrate the tester so they can all work at the same time. This will become a utility screen that will serve you well when maintaining the critter latter in its life.
    Only then...
    write out a complete set of state diagrams that describe what you plan to do (don't cheat! ) and walk through them in your head until you are cetain it will all work blah blah blah.
    This step is optional but highly recomened...
    Compose a detailed set of documemtns describing what you have in mind and post them here (include the images, they will get many mor readers) and let people  pick aprat your design.
    When you have a final design, use everything you learned along the way to be a kick-ass developer.
    Along the way post distinct well defined question on this site and as long as it looks like you are trying someone will probably reply and get you going again.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Controlling Menu Bars of Windows Applications like IE and Editor with LabVIEW 6

    Hi everybody !
    I'm trying to develop a vi (LabVIEW 6) which controls menu bars in
    Windows Applications (IE, Editor, etc.) like "File-Save As..." or
    "View-Source...". I'm pretty sure I've got to use the ActiveX
    possibilities in LabVIEW, but I haven't been succesful. Any comments
    will help.
    Thanks

    You can use Win32 API to simulate a key-press (e.g. ctrl-S for Save)
    for IE or any window applications, as long as the application has
    short cut for menu items, and active.
    You can use external code (VC, VB, dephi, etc..) to build DLL, CIN, or
    ActiveX, call them in LabVIEW.
    I made "Send Keys.vi" in G Toolbox.
    If the menu item doesn't has a shortcut, you can send a message (use
    spy tool to find out) to the application.
    George Zou
    http://gtoolbox.yeah.net

  • Size hard disque and RAM with Labview 2009

    Hello,
    I need to know please, how can I have the hole hard drive size and the free hard disque size using LabVIEW.
    Same thing for the RAM : hole size and free space size.
    Regards,
    Solved!
    Go to Solution.

    For the hard drive, there is the Get Volume Info function.  I know there's a trick to get the RAM, but it is eluding me right now.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Is axis ptz 215 ip camera compatible with labview?

    Hi I am working with labview for my final year project and am trying to find a ip camera which will work in labview.
    I wish to use the axis 215 ptz but want to make 100% sure that I will be able to capture video input from it before I purchase it.
    so
    1, will i be able to capture video into labview with a axis 215ptz?
    2, Will I be able to control the pan tilt and zoom controls of a axis 215 ptz labview?
    and if so any help as to how would be great also thanks for your time.

    I and a NI engineer tried various ways to get it to work in labview he was quite helpful.
    After installing the camera and checking on internet explorer that it worked and was a valid IP for the computer we tried the following in labview.
    Measurements and automation explorer under device interface and remote systems couldn’t find the Samsungs IP or name
    Another way I tried was vision and motion vision express once again the camera couldn’t be found even though through the same method the Ni engineer could find his supported camera a different one to the Samsung.
    Yet another way was through vision assistant in which we tried the acquire image from ip camera driver and once again the Samsung was not found.
    On conclusion the Ni engineer concluded the Samsung wasn’t supported and thus after research we tracked down that apparently axis and basler cameras are supported. Of these specifically I wish to use the axis 215 ptz I emailed the same question above and an NI engineer replied
    Hi Nicholas,
    You can use the Axis 215 pzt camera to control and use with LabVIEW there is no problems at all. Make sure you don't change the firmware that comes with the camera, As this can cause it not to work.
    Please let me know if you have any further questions.
    Ruchira Gunatillake
    National Instruments
    Applications Engineering “
    Thanks for enquiring Im now in the process of hoepfully getting a ptz axis camera and giving it a shot!
    Regards Niko2011n

  • Sony's i.link with Labview

    Hi: I have a Sony Digital Camcorder and I want to adquire digital video
    from it and process with Labview. Does someone know what hardware should
    I use and if it has the apropiate drivers to do what I want
    Thank you very much
    Francisco Picatto

    You need to ask the people who own the house what the account information is. If they do not know, they would need to reset it. They should contact their internet service provider for directions. Note that many routers have a default password on a sticker on the bottom. If the owner has never changed it, you may find it there.
    Best of luck.

Maybe you are looking for

  • Using Graphics2D from a method

    Hello everyone, I am still trying to make a method that will use Graphics2D to draw a line etc... Here is what I tried... int drawx() { Graphics2D g2D = (Graphics2D)g; // Get a 2D device context g2D.setPaint(Color.blue); Point2D.Float h2a = new Point

  • Aperture 3 not importing in order

    When importing from my Nikon to Aperture 3 the images are not in order- they are randomized (and not even during the same shoot).

  • How to use Connection Pool in ADF ear file creaion from jDev 10.1.3

    Hi, We are developing big application in ADF with 10 different modules. We are creating ear file with data source setting. How to use connection pool while creating ear file from jDev. Connection pool is alreday created in Application Server 10g. Wha

  • ERROR: WinHttpReceiveResponse failed 80072ee7

    This the message from the configmgrSetup.log: INFO: checking if there's an explicit proxy server.  $$<Configuration Manager Setup><04-10-2014 23:28:12.865+240><thread=4176 (0x1050)> ERROR: WinHttpReceiveResponse failed 80072ee7  $$<Configuration Mana

  • Mail not showing up on macbook pro

    mail is not showing up on macbook pro but does on my ipad2 and iphone4