Excel Macro problems

I have Labview 8.2.
What I am trying to do is create an excel called XXX.xls.  In that Excel file, I want to create muliple sheets called X1 X2 X3 and so on.  I looked at the example, but could not find anything that will allow me to open the excel file and insert the names that I want to call each sheet.  It only creates one sheet called that same thing as the file name.  Can labview do this, or do I have to open that file each time and can only create one sheet at a time?
Next, when I write my data to the sheet, I have to shut the program off, change my condition and start the program back up.  When doing so, it reopens the file, but deletes the data.  Is there selection that will allow me to append to the file rather then deleting what's in the file after reopening?
Thanks,
Travis

Not sure which example you're referring to. That said, programming something like Excel is a pain in LabVIEW due to the ActiveX interface. Your programs tend to get very wide and you're tossing around references on the block diagram like spaghetti <insert Homer Simpson sound here>. The first part of what you're asking basically involves opening Excel, opening a new workbook, and adding sheets if the number of sheets you want is greater than 3, which is the number of sheets Excel automatically adds when you create a new workbook. The attached VI should get you started to give you an idea of what you need to do.
Attachments:
Excel Add Sheets.vi ‏29 KB

Similar Messages

  • Export to Excel - Macro problems

    I have moved this to the Discoverer forum. Exporting to Excel - Macro Problems
    Message was edited by:
    user385142

    Hello Denes.
    Excuse me for send you a message in this way , but I dont find other way to contact with you.
    Im using the export_excel_pkg, and really it work good.
    I have only one problem, I tell you.
    When, in one item, data is very long and numeric, by example a EAN code, without any class of format, by default it give me the value ###, Im studing the package and trying to resolve this, but if you can send me any idea it can help me a lot.
    Thanks in advanced.
    You are doing a great work for us.

  • Exporting to Excel - Macro Problems

    For reasons unknown to us, when we export our crosstab reports from Discoverer 4i to Excel(2000 or 2003), we are getting a dialog message box warning us of the following, "The document you are opening contains macros. Some macros may contain harmful viruses. If you are sure this document is from a trusted source, Click Yes. If you are not sure and want to prevent any macros from running, click No." If we click Yes, then it will download two sheets, the first complete with drop down boxes etc and the second sheet just contains the regular crosstab report that we used to get but with formatting included, aka grey shaded columns etc. We checked the ExcelExportWithMacros pref and it is set to 0, the macro security on Excel is set to medium.
    Any ideas would be welcome.
    Thank you

    The macro warning is something that's well known when exporting to Excel. Just for grins, try putting your security at low to see if it still warns. There may be some kind of macro that gets sent with the export (this has been discussed before), but not really sure. However, many clients I've been at just accept it and click Yes. I believe it's a 4.x thing (ie: I hope it's been corrected in 10g), but haven't tried that yet to be sure.
    As for the export having more than one worksheet, I believe I remember that this is also a known 'challenge' (ie: it doesn't just come out like a pivot table in 1 worksheet) and again, I'm pretty sure it's only a 4.x thing.
    Also, are there 2 options for exporting to Excel for a xtab (ie: export to Microsoft Excel Workbook (.xls), Microsoft Excel Pivot Table (.xls)? If so, try each as the first is for static sheet only info and the latter exports a 'static sheet', a 'pivot table' and 'warning sheet'.
    Also see metalink doc: 214075.1 for one possibility.
    Also see metalink doc: 157162.1 for another idea.
    Russ

  • Using Excel macros & change properties

    Hi,
    1) my program use Excel macro via a runtime.exec(cmd). I want to use JWS to deliver new versions of application but if I have to put my macros in a jar file how can I reach them (no problem with a file propertie or with gif ressources).
    2) how can I change default properties ("Dossier des applications" in French maybe Applications dir in advanced) wich is enabled in the window.
    thanks a lot
    Sophie

    1) my program use Excel macro via a runtime.exec(cmd).
    I want to use JWS to deliver new versions of
    application but if I have to put my macros in a jar
    file how can I reach them (no problem with a file
    propertie or with gif ressources).You have a lot of options how to do this.
    I would try to use the I/O APIs that reads the macro file
    from a web server (InputStream is = url.openStream()) and put it
    in a local file (FileOutputStream = new FileOutputStream(file)).
    Of course you would need a local location where to store it, could
    be hardwired, or asked from the user.
    2) how can I change default properties ("Dossier des
    applications" in French maybe Applications dir in
    advanced) wich is enabled in the window.I do not understand what you want to do. Explain again.
    Regards,
    Marc

  • Execute Infopackage Through BAPI Using Excel Macro (BAPI_IPAK_START)

    Hi everyone,
    I have a problem when execute infopackage through BAPI using excel macro. I have create a button in macro. When this button is clicked, BAPI for trigger InfoPackage will executed (BAPI_IPAK_START) and this button will disabled.
    After this process completely done (traffic indicator for the request is green in update rules), the button will enabled again.
    Here the subroutine or pseudocode that i will write :
    Private Sub ClickButton()
    Begin
    1. ThisButton.Activated = False   --> Disabled Button
    2. Call BAPI/custom Function Module to execute InfoPackage (BAPI_IPAK_START)
    4. ThisButton.Activated = True   --> Enabled Button
    End
    The problem is i need some statement like this between statement no 2 and statement no 4
    Statement That I Want :
    3. Wait Until BAPI Execute Completely
    So user can click this button again only after the process is finished completely. I don't know how to do this in macro (in ABAP i know i can use "WAIT ... SECOND"), others said this can be done using event in schedule option at infopackage. Anyone,please help me.
    Thank you.
    Regards,
    Satria B

    Enter that req number in RSRQ and monitor the load
    or  right click on the DS - manage - you will req in yellow status which is in progress and you can click on the ...takes you monitor screen
    Edited by: Srinivas on Jul 6, 2010 7:51 AM

  • Essbase Excel Macro's and Mxl client

    Hello Folks,
    We are working on 11.1.2.1 having Essbase, Planning, HFM and financial Reports & ODI. We have built the environment newly. I have a scenario where we need to run the ODI batches and run the excel macros to load some of the data. Our batches run from ODI. We have distributed environment for Hyperion servers, totally 3 servers.
    Components in distributed environment:
    1. Shared services, Planning, HFM client, BI Reporting tools, EAS client, Maxl,ODI(server1)
    2. Essbase Server,Maxl(server2)
    3. HFM(Server3)
    MS office & ODI installed on Server1.
    We need to run the batches using ODI & Excel Macro's to load the data.
    I have setup  the maxl client in Server1 for the ODI batch to use for loading data into essbase but my problem is i want to use excel macro's also same time. Is there any possibility or workaround to use both at a time on same servers?
    Thanks,
    Tamas

    What is the error you are getting while running it from ODI? I'm assuming that you are getting some error when you said only one is working.
    When you install EXCEL Add-in it is changing your path and abrorpath variables and that could be the reason why maxl is not working. If ODI is using a bat file why don't you set temporary variable and try.
    in you bat file add these lines (before the maxl call, i would ad them to the start)
    SET ARBORPATH=C:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient
    SET PATH=%ARBORPATH%\bin;%PATH%
    Regards
    Celvin
    http://www.orahyplabs.com

  • Excel macro issue

    I have an employee that uses the add-in and works with macros a lot in Excel. Occassionally, we he opens an Excel macro, it causes the Essbase toolbar to stop working. The dropdown essbase menu works, but the toolbar does not. He has to go through our service desk to get this resolved. Anyone know what causes this to happen?

    I would imagine that this is an intermittent problem or does it relate to a specific macro in a specific Excel worksheet ? Problem should go away with a reboot, another question would be why you are suporting freeware ? It should always come with a warning that it is freeware and outwith any company support policy. In most organisations the behaviour of user created macros is something that an IT support function will not go anywhere near.

  • Excel Macro Plotter

    Hello All,
    I am having a challenge in implementing a macro in excel that plots the waveform graph. I have made use of the LabVIEW Excel macro Example with modifications. The challenges are:
    1.       In Excel, both x and y values do not start from zero.
    2.       The scale of the graph is narrow
    3.       The program should stop running after the log switch is pressed and the graph is plotted in excel.
    Note: project.xls sheet should be in same directory as VI before running.
      Thanks.
    Attachments:
    ExcelExamples.llb ‏97 KB

    maxidivine wrote:1.       In Excel, both x and y values do not start from zero.
     I'm not sure I understand what you mean by this.
    2.       The scale of the graph is narrow
    I don't understand what this means either. I assume you're referring to the fact that you're only seeing a "zoomed in" version of the graph. The reason for this is that the macro in the workbook has the range to graph hard-coded in it. It's only plotting the first six rows. You can either modify the macro so it determines the range based on the data (see Excel help on how to write macros), or have it so that you feed in the number of rows as an argument. 
    3.       The program should stop running after the log switch is pressed and the graph is plotted in excel.
    It should already do this, and it does. I suspect the problem you're having is when you're running it with the large array. Writing out 25000 cells one at a time using ActiveX will take forever. 
    As an aside: What's wrong with the LabVIEW graphs?

  • Custom Excel macros can't be accessed by new admin user, only original developer

    Excel macros created several years ago using NI Measure are not accessible to users other than the original developer.  We are using Win 2000 OS, NI Measure version 1.2 upgraded from version 1.0, and Microsoft Office Excel 2003 SP1.  Even if the user has the same admin rights as the original developer of the macro, they cannot access it.  The macro is accessible and works fine when the original developer logs into the win 2000 pc with his login name and password.  Has anyone else had this problem?  Does anyone know how we can resolve this issue?
    Thanks,
    Alex H.

    Alex,
    The first thing to try would be to install the patch for Measure (Measure Patch 1.2c) if you haven't already.  Do you have this same issue when trying to access Macros not created by Measure?  Unfortunately, the best I could find on Macro and Measure issues were the following KBs. 
    General Measure Support KB
    Macro and Measure Support KB
    Hope this helps!
    Andy F.
    National Instruments

  • Excel Macro Help - SendKeys

    I hope this is the right forum - sorry if it's not. I'm working with Excel Macros. Having a few problems adjusting to Mac from PC. I want to do a send key type command to close a web window (command F4). In my PC, the command was:
        Application.SendKeys "%({F4})"
    I'd like to do a send key type command on the mac for "command+F4".
    I have no idea what I'm doing - I admit, but I've basically successfully pieced together bits and pieces of help from various web sources and made some macros that do what I need. This is one I haven't been able to figure out.
    Thank you so much and again, I'm a newbie, so be kind! Thanks :-)
    Kat

    bump *

  • Acrobat have features similar to excel macros?

    Does acrobat have a feature similar to excel macros? Example, clicking a button on title page starts a new form page with logo and questions already in place? The problem is the number of forms per customer is different so I would need the title page to have a built in function that generates new form pages.

    Acrobat uses the JavaScript scripting language to provide automation code.
    Acrobat also has the ability to edit the tool bars.
    There is a built in tool to insert or add a new blank page.
    One can also create a template that can be used create a new page from itself and it can include images and form fields. And if you program it correctly the fields will be renamed for each page and the scripts for performing the calculations will automatically adjust for the added page.

  • Running Excel macros from ABAP

    Hello everyone,
    I am trying to execute an Excel macro from an ABAP program.  We are currently on a 46C system.  While doing some research on help.sap.com I came across the method execute_macro in class i_oi_document_proxy.  I’ve never used methods in ABAP before and I’m not really sure what I’m doing.  Has anyone got this to work?  When I try to run the program it dumps with error OBJECTS_OBJREF_NOT_ASSIGNED.
    Thanks,
    Becky
    Here is the program:
    REPORT ztest_program.
    INCLUDE ole2incl.
    DATA gs_excel TYPE ole2_object .
    DATA gs_wbooks TYPE ole2_object .
    DATA gs_wbook TYPE ole2_object .
    DATA gs_application TYPE ole2_object .
    DATA: h_sheet TYPE ole2_object.
    DATA: document TYPE REF TO i_oi_document_proxy.
    *Name of the macro in Excel
    DATA: macro_string(50) TYPE c
                     VALUE 'FB03process.FromTheBeginning',
          no_flush TYPE c,
          param_count TYPE i VALUE 0,
          script_name TYPE c VALUE 'X',
          error TYPE REF TO i_oi_error
                OCCURS 0 WITH HEADER LINE,
          retcode TYPE soi_ret_string,
          error_string(50) TYPE c,
          retvalue(30) TYPE c.
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
             text       = text-007
         EXCEPTIONS
              OTHERS     = 1.
    CREATE OBJECT gs_excel 'EXCEL.APPLICATION' .
    SET PROPERTY OF gs_excel 'Visible' = 1 .
    GET PROPERTY OF gs_excel 'Workbooks' = gs_wbooks .
    GET PROPERTY OF gs_wbooks 'Application' = gs_application .
    *--Opening the existing document
    CALL METHOD OF gs_wbooks 'Open' = gs_wbook
         EXPORTING #1 = 'D:\temp\FB03process.xls' .
    tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
       EXPORTING
              PERCENTAGE = 0
             text       = text-009
         EXCEPTIONS
              OTHERS     = 1.
    GET PROPERTY OF gs_excel 'ACTIVESHEET' = h_sheet.
    CALL METHOD document->execute_macro
         EXPORTING macro_string  = macro_string
                   param_count   = param_count
                   script_name   = script_name
                   no_flush      = no_flush
         IMPORTING error         = error
                   retcode       = retcode
         CHANGING  error_string  = error_string
                   retvalue      = retvalue.
    disconnect from Excel
    FREE OBJECT gs_excel.
    PERFORM err_hdl.
    FORM err_hdl.
      IF sy-subrc <> 0.
        WRITE: / 'Fehler bei OLE-Automation:'(010), sy-subrc.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL

    Hi,
    Please correct me if I am wrong but it seems that you have not fetched a handle to the document object before issuing the statement CALL METHOD document->execute_macro. Hence the error OBJECTS_OBJREF_NOT_ASSIGNED is being dislayed. If you want to use SAP Desktop Office Integration using ABAP Objects, take a look at this article at http://www.intelligenterp.com/feature/archive/ or http://www.sapinfo.net/public/en/index.php4/article/comvArticle-193333c63b4bd807d2/en/articleStatistic
    Hope this helps.
    Regards
    Message was edited by: Shehryar Khan

  • How to call excel macros programmatically in C#?

    Hi,
    I have a requirement where i need to call excel (2003) macros in C# program. Can anyone help me with a code snippet to do the same?
    The excel macro function takes two input parameters? how can the parameters be passed?
    Any code snippet to do the same in C# would be helpful.
    Thanks.

    Hey there, Sid.  I am tryin gto run your code, but I couldn't even gte it to fire.  Here's what I ahve now:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using Excel = Microsoft.Office.Interop.Excel;
    namespace WindowsFormsApplication2
        public partial class Form1 : Form
            private void button1_Click(object sender, EventArgs e)
                //~~> Define your Excel Objects
                Excel.Application xlApp = new Excel.Application();
                Excel.Workbook xlWorkBook;
                //~~> Start Excel and open the workbook.
                xlWorkBook = xlApp.Workbooks.Open("C:\\Users\\Ryan\\Desktop\\Coding\\Microsoft Excel\\Work Samples\\Work Samples\\Historical Stock Prices.xlsb");
                //~~> Run the macros by supplying the necessary arguments
                xlApp.Run("ShowMsg", "Hello from C# Client", "Demo to run Excel macros from C#");
                //~~> Clean-up: Close the workbook
                xlWorkBook.Close(false);
                //~~> Quit the Excel Application
                xlApp.Quit();
                //~~> Clean Up
                releaseObject(xlApp);
                releaseObject(xlWorkBook);
            //~~> Release the objects
            private void releaseObject(object obj)
                try
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                    obj = null;
                catch (Exception ex)
                    obj = null;
                finally
                    GC.Collect();
    When I hit the play button nothing happens.  When I hot F5 nothing happens.  Do you ahve any idea what I'm doing wrong.  I'd appreciate any advice with this!! 
    Thanks!!
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Excel macro error after deploying in Weblogic

    Halo,
    I have written excel macros and it is working fine.
    but if the same file if i try to open from hyperlink after deploying in Weblogic server , I get the error
    "error occured initializing the VBA libraries.
    If Microsoft Visual Basic for Applications (VBA) was not installed, or was set to Install on first use,
    (advertised, or set to install on demand) you may receive this error message.
    Depending on the mode of installation used and the rights of the user to change current settings,
    it is possible to install VBA through Control Panel, Add/Remove Programs, Microsoft Office, Add or Remove
    features. If Visual Basic for Applications is not listed as an installable feature of Office, the administrator
    of your system may have disabled it so it is impossible for you to install it. If VBA is not installed,
    it is impossible to run VBA applications/projects on this computer. "
    1. Even though Excel VBA application is installed in my machine , why am i getting this error.??
    2. I would like to know is there any way to open the excel file even though if the excel software is not installed in client machine??
    Appreciate your help.
    Thanks.

    Hi,
    I do not see any reason for this to not work.
    Is there any difference between the preferences for RX and RXI. Please go to "edit" -> "Preferences" -> "Security(Enhanced)" and uncheck "Enable protected mode at startup".
    Are you able to open any pdf from command line with the same command:
    "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe"  <<PDF_FILE>>
    Thanks,
    Amish.

  • How do I make an Excel macro and Labview push to copy Labview calculated data into a cell on demand?

    Hey there, I am a chemist so Labview and programming aren't exactly my strong point. 
    We have a Labview program that we run to control and automated valve manifold that has a thermocouple and pressure transducer that displays the temperature and pressure on the "front panel" of the labview file we run.  The temperature and pressure of the manifold changes in real time while the labview is running.  We must attach a sample to the manifold, take the pressure and temperature, then record those values in an excel spread sheet, one at a time.
    What I would like to do is make a key board macro in excel to automatically type in the current read out of the temperature (and another for pressure) into which ever selected excel cell you are on, so that you don't have to switch back to the labview window to look at it.  I have a very basic understanding of macros in VB but I don't know how to get the labview to make the read outs available for the excel macros to find it.
    Thanks for the help, Here is a screen shot of the block layout of the program.
    Attachments:
    back.JPG ‏79 KB

    Why not have LV put the data in Excel for you?  You can use Actvie X to do this.  There is plenty of information on the forum and knowledge base on how to use Active X and reporting to Excel.  Plus you have the example finder.  Do you have the Report Generation Toolkit?  LV7 is quite old, so I don't know if this is an option for you.
    Reese, (former CLAD, future CLD)
    Some people call me the Space Cowboy!
    Some call me the gangster of love.
    Some people call me MoReese!
    ...I'm right here baby, right here, right here, right here at home

Maybe you are looking for