Excel report - lauch VBA function automatically

Hi Experts,
I'm working on a Excel report (BI7.0) for stocks and goods movement.
I want to underline low stock and to do this, i create a macro in VBA to change the cell's background in red.
My code runs perfectly when i click on the button to launch the function.
But now, i want to lauch this function automatically.
1) open the workbook
2) enter the parameters
3) display the table
4) CHANGE THE COLOR for low stock cells
I'm unable to find how to launch the function "on step 4", and my cells stay again and again with white background.
Can you help me?
Thanks a lot,
Adrien

What if I were using Adobe 9.0, what would my vba code look like?
The reason that I'm changing to Print As vs File Save As is due to the file size.
Print As - makes the file about 100k
File Save As - make the file about 10M
My vba works fine when sending to "File Save As *.pdf", but when I change it to Print As PDF, the vba won't capture the filename automatically from my vba code.
What would my vba look like if I were using 9.0 to get Print As PDF to capture the filename automatically?
Or tell me how to decrease the file size when vba calls "File Save As *.pdf".
Thanks!!!

Similar Messages

  • Report generation Toolkit: Excel report functions error -2146827284

    Hi,
    I'm trying to create an automated report using excel functions from the report generation toolkit in labVIEW. When I run the program that generates the report first time round (the report consists of several worksheets, each worksheet is added onto the report at a diffferent state in a state machine) it always works fine and no error is generated. However, when I run the program again it will infrequently (sometimes it does, other times it will not) generate the undefined error -2146827284, this is coming from one of the excel report functions and it cannot find it on highlight execution mode.
    Does anyone know anything about this error, why it occurs, how to prevent it?
    I would appreciate any help.
    Thanks,
    Rowan

    mebels_cti wrote:
    Found something that helped; https://forums.ni.com/t5/LabVIEW/Error-code-quot-2146827284-quot-when-trying-to-open-an-Excel/m-p/20...
    Excel still open
    So I added this;
    You should use the Application Quit method instead of killing the task. I doubt this is the cause of your issue.
    Ben64

  • How automatically save excel report?

    Dear sir,
    I am generated excel report using labview,
    Present my doubt is how to Save Automatically that report in specified directory....?
    Please Inform me,
    Thank you...
    Solved!
    Go to Solution.

    Please replay this question
    How to export wave form data in excel with specified location,
    i.e.. Specified column,
    How it is possible?
    Thank you.

  • Custom VBA Functions BPC

    Hello,
    I would like to know how to use custom VBA function in BPC. I read the administration guide but I didn't understand this part.
    For instance, if I want to use the "BEFORE_REFRESH" function, where do I have to implement it ?
    Thanks in advance

    Hello Mark,
    I've also used BPC VBA functions quite extensively to extend BPC capabilities with success up until now, but I am now struggling with finding a way to make them work when registered as macros from an external add-in.
    The scenario is the following: I currently leverage custom VBA macros (BEFORE_EXPAND, AFTER_EXPAND, etc) to extend BPC functionalities, and the code is distributed in the VBA modules attached with my input schedules/reports spreadsheets.
    I then decided to consolidate the functionalities in an Excel automation add-in, which (among other tasks) registers the same macros once at Excel startup to be used by all the different input schedules / report: macros are registered and exposed correctly (they are showing up in the list of available functions) but for some reasons they are not fired by the Expand All or Refresh menu actions.
    Any idea about why the macros are not executed? Do they necessarily need to be written in a VBA module attached to the spreadsheet?
    Many thanks in advance.
    Regards
    Jacopo

  • BPC Custom VBA Functions questions

    Hello, Experts
    I am developing some formatting scripts which are run inside functions AFTER_EXPAND, AFTER_REFRESH.
    I have several sheets with EVDRE
    I don't understand the following things:
    1. How I can trigger which list was refreshed & expanded?
    2. Why calling EVDRE : Expand & Refresh doesn't lead to execution AFTER_EXPAND and AFTER_REFRESH? AFTER_REFRESH work only in Refresh, AFTER_EXPAND in Expand all. How can I trigger calling "EVDRE : Expand & Refresh "
    3. BPC Custom VBA Functions have String argument inside itselves. Usually this argument is empty. What's the goal of this argument?

    Hello Mark,
    I've also used BPC VBA functions quite extensively to extend BPC capabilities with success up until now, but I am now struggling with finding a way to make them work when registered as macros from an external add-in.
    The scenario is the following: I currently leverage custom VBA macros (BEFORE_EXPAND, AFTER_EXPAND, etc) to extend BPC functionalities, and the code is distributed in the VBA modules attached with my input schedules/reports spreadsheets.
    I then decided to consolidate the functionalities in an Excel automation add-in, which (among other tasks) registers the same macros once at Excel startup to be used by all the different input schedules / report: macros are registered and exposed correctly (they are showing up in the list of available functions) but for some reasons they are not fired by the Expand All or Refresh menu actions.
    Any idea about why the macros are not executed? Do they necessarily need to be written in a VBA module attached to the spreadsheet?
    Many thanks in advance.
    Regards
    Jacopo

  • My excel report is not working in executable file ,however,it works well in vi

    Hi all ,
         Could any one please help me in getting the reason behind the executable file not working for excel report generation,however I can get the same function without any problem in main vi.
    I am attaching my code and executable file also ,please have a look into it and let me know where I am wrong.
    Thanks & Regards !
    sarita
    Message Edited by MindPower on 10-24-2007 01:40 AM
    Message Edited by MindPower on 10-24-2007 01:43 AM
    Attachments:
    test datalog.vi ‏264 KB
    test datalog-NEW.zip ‏1020 KB

    I can't open the vi in the moment. But by your description I think that I know the solution.
    When you build the executable you've to add dinammically the vi's from report generator that aren't in your main vi hierarchy. So, you've to open the vi's and find those that are open trough "open vi reference" and add them dinamicaly.
    And don't know if these tips are enough.
    From NI Zvezdana S.
    "When you use the Report Generation Toolkit to build a stand-alone application with the Application Builder, you must add _Word Dynamic VIs.vi from _wordsub.llb and _Excel Dynamic VIs.vi from _exclsub.llb as dynamic VIs. These two VIs contain subVIs that are called dynamically by the high-level Report Generation VIs. I believe that if you grab these VIs from the (desired office version part of the) installation CD instead of from the development machine, then everything should work. "
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL

  • Excel report generation error

    Hi,
    Does anyone have experienced (and solved) this behaviour?
    I've been using the report generation toolkit to build word report without
    problem. I've also solved a lot of problems in the excel part of the toolkit
    (e.g. building graphs with >20000 points). It finally works in development
    environment.
    Now when I install the executable (, with the installer) the word reports
    still work, but the excel report don't. The executable does run on a
    different system, but the excel versions are the same (both Excel 2000).
    I have copied the excel library in the data directory of the executable.
    The following error is generated:
    -2147319784
    Old format or invalid type library
    Excel_Open.vi
    This is the first report generation vi that is called. I us
    e it to open a
    template.
    Any help is appreciated.
    Wiebe.

    Hi,
    Surfing the internet, I found this comment:
    *Start quote*
    Sometimes you'll find that a parameter is required that isn't mentioned
    anywhere in the application's documentation. This happens when you need to
    specify system information: the chief example of this is the lcid, which is
    a locale identifier, and which pops up all over the place in Excel. The good
    news is that there is a constant in the Windows unit which provides you with
    the correct value, LOCALE_USER_DEFAULT:
    var
    lcid: integer;
    begin
    lcid := LOCALE_USER_DEFAULT;
    Excel.Visible[lcid] := True;
    There's also a function, GetUserDefaultLCID, but using that value can cause
    an error, complaining about an 'old format or invalid type library' on some
    setups. Using LOCALE_USER_DEFAULT for the
    LCID value should fix that.
    *End quote*
    Could this be the problem?
    Regards,
    Wiebe.
    "Wiebe@AIR" wrote in message
    news:3e79a3aa$0$140$[email protected]..
    > Hi,
    >
    > Does anyone have experienced (and solved) this behaviour?
    >
    > I've been using the report generation toolkit to build word report without
    > problem. I've also solved a lot of problems in the excel part of the
    toolkit
    > (e.g. building graphs with >20000 points). It finally works in development
    > environment.
    >
    > Now when I install the executable (, with the installer) the word reports
    > still work, but the excel report don't. The executable does run on a
    > different system, but the excel versions are the same (both Excel 2000).
    >
    > I have copied the excel library in the data directory of the executable.
    >
    > The following error is generated:
    >
    > -2147319784
    > Old format or invalid type library
    > Excel_Open.vi
    >
    > This is the first report generation vi that is called. I use it to open a
    > temp
    late.
    >
    > Any help is appreciated.
    >
    > Wiebe.
    >
    >

  • Excel report generation

    Hello,
    I am looking for a simple solution to this simple problem:
    I have generated an excel data file using LabVIEW Report Generation Toolkit for Microsoft Office ( see diagram below ).
    Now I would like to add data to this worksheet every time I run this VI ( data must expand in column format instead of
    row)  but i have no Idea how to do it .
    I would appreciate any help.
    Thanks 
    Attachments:
    Excel Report.jpg ‏59 KB

    That's what the start input is for. You tell it where to insert the cells.
    Asides:
    Why aren't you wiring the error out from the new report function to the next function?
    Do not autoindex an array and wire a value to N. Do one or the other, not both. If you do both the loop will run for whichever value (N, or the array size) is smaller.
    Your loop with the function node can be simplified by replacing it with a single Divide function and feeding the Divide function the arrays directly. The numeric functions (as well as many other functions) are polymorphic.
    To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • Excel report generation does not exit excel

    I am using the excel report generator to save test reports.  I can create the report using a template and write to it when needed with no problems.  After every test step I add data and save the report.  I keep excel closed by using the no change setting for the window state.  I do not want the user to see excel or even know it is there.
    The issue is when I am done testing and use the dispose report vi, it leaves an instance of excel open that you can see in the task manager.  And the only way to close that instance is to open one of the files that was created and close it and then exit excel.  The memory used by that instance grows a little each time a new file is created.
    Labview 2011 SP1 (11.0.1.F2 32bit)
    Excel 2007
    How can I close excel completely after each test?
    Solved!
    Go to Solution.
    Attachments:
    Report Example.png ‏52 KB

    I find it very hard to believe that this function isn't somewhere in the report generation toolkit.  But my 30 second look for it came up with nothing.  So instead I wrote a function that does a task kill for you.  Keep in mind this only works in Windows, and this will do the same thing as a end task in Taskmanager so only use it when you are sure your are done saving all reporting.  Saved in 2011.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Taskkill Excel Report.vi ‏22 KB

  • How to Extract data from a Request management tool to Apex to avoid working on Excel reports

    Client uses a ticketing tool,I donot know what is the database for the tool,but I would like to know the best way to extract data from the tool to pex so that we can eliminate working on Excel reports.These excel reports are basically the open request log,resolved tickets,aging tickets etc,currently we work on many excel reports,can we achieve this in Apex ,if so how do we achieve this.Then we would like to use this report and prepare multiple charts,how the above two requirements can be mapped.

    A very important function for the system will be - one sends an email in certain format to a dummy email address, then some data will be extracted from the email based on the pre-defined format and inserted into the database my APEX application is using.
    Any idea on how I can make it happen please? I agree that this is not really an Apex question, but a more general PL/SQL question.
    There are many approaches, all boiling down to one of these two:
    1) Push: Some process in the mail server sends/forwards information to your database when new mail arrives.
    The language/tools used to do this, and the way it would connect to your database, depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    2) Pull: Some process in the database contacts the mail server and polls for new information.
    Ie. some PL/SQL code would communicate with the mail server. Again, it depends on your environment (what is your operating system? mail server? existing middleware/tools? security protocols used? etc.).
    For example, if you are using Exchange 2007 or newer, it has a web services API:
    http://msdn.microsoft.com/en-us/library/dd877045.aspx
    The challenge here will be to build the correct SOAP requests from PL/SQL, and to handle the security protocols used.
    - Morten
    http://ora-00001.blogspot.com

  • How to set a busy cursor when the excel report pops-up(in Excel)?

    I'm using LabVIEW 7.1 and Report Generation Toolkit for MS Office to build a VI. at the end of each session when the data in a certain peroid of time was collected, the data will be transmmited to Excel report. the problem is during the poping-up of Excel report, if the cursor clicks inside Excel accidently, all the collected data will disappear and the blanks in Excel will no longer be filled automatically. I have tried to use Set Busy.vi, but it only works in VI panel, not in Excel. Will someone please help me?
    thanks very much

    Hi jingli,
    For changing cursor appearance, you can visit another post on the forum:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RNAME=ViewQuestion&HOID=506500000008000000272E0000&ECategory=LabVIEW.LabVIEW+General
    (search for mouse pointer appearance in this forum if the URL doesn't work)
    Another suggestion would be setting the windows appearance to "minimum" when you open your Excel report (wire it at the New Report VI).
    Dan

  • Best Practice for creating Excel report from SSIS.

    I have a requirement to create an Excel report on a daily basis which pulls data from SQL. I have attempted to resolve this by creating a stored procedure to save the results in SQL, a template in Excel to hold the graphs & pivot tables and an SSIS package
    to copy the data to the template.
    Problem 1: When the data turns up in Excel it is saved as text rather than numbers.
    Problem 2: When the data turns up in Excel it appends the data rather than overwriting it.
    I resolved problem 1 by having another sheet which converts the text to numbers (=int(sheet1!A1))
    I resolved problem 2 by adding some VB script to my SSIS package which clears the existing cells before copying the data
    The job runs fine, however when I schedule the job to run overnight it complains "System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID". A little googling tells me that running the client side commands in
    my vb script (workSheet1.Range("A2:F9999").Clear(), workBook.Save(), workBook.Close() etc) from a server side task is bad practice.
    So, I am left wondering how people usually get around this problem; copy a SQL table into an existing Excel file and overwrite the data, without having the numbers turn up as text. My requirements are that the report must display pivot charts with selectable
    options and be automatically updated overnight.
    Help appreciated,
    Bish.
    Office 2013 on my PC, Office 2010 on the server, Windows Server 2008R2 Enterprise, SQL Server 2008R2.

    I think that the best practice in case like this is to Link an excel file to a view or directly to a table. So you don't have to struggle with changing template, with overnight packages, etc. If the data are too much complex and the desiderate too excessive
    then I tend to create a Cube and that's it...dashboard, graph and everyone is happy. In your case if the request is not too much try to don't use SSIS but directly build a view and point directly on SQL.
    SSIS is really strong for the ETL, to run some stored procedure too heavy, to use a cut time scheduled, etcetera , etcetera, etcetera...I love it. But sometimes we need to find the easier solutions...
    I hope this post helped you

  • Revised "Generate Excel Report" Example

    I recently answered a question from a Forum user about an error encountered when trying to generate an Excel spreadsheet with the Report Generation Toolkit.  I thought that the example code he was using was "unusual" and overly complex, and just discovered that it was, in fact, the LabVIEW 2013 "Generate Report From Template (Excel)" Example.
    In the spirit of trying to demonstrate how nice the new(er) "Easy Excel" functions are, I rewrote this Example, and have attached it here.  While doing so, I discovered (and have reported to NI) a "bug/feature" of the Excel Insert Graph function.  One of its parameters allows you to position the graph by specifying the Left and Top edges (Left would be the Excel Column, Top would be the Excel Row).  The only problem is that the parameters are reversed -- to put the graph on Row 1, Column G, you specify (0, 6), not (6, 0).  Oops ... 
    Solved!
    Go to Solution.

    Here is a Snippet, in LabVIEW 2012, of the Excel Demo (the Revised Generate Excel Report Example).  If you have LabVIEW 2012 or more recent, you should be able to drag this into a blank Block Diagram and have the VI "magically" created.  If you have an earlier version of LabVIEW, you can at least see a picture of all the VIs and wiring here, and can open LabVIEW and "build it yourself".  There are no Case statements, so nothing is hidden from view.  In case the image is too small, I also attached the PNG file, which you should be able to open with an Image Viewer and potentially print out for yourself.
    Attachments:
    Excel Demo.png ‏108 KB

  • Excel Report JSP Exception

    Hello All,
    I am unsuccessfully following the "Output to Excel with Oracle9i Report" tutorial found at http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html to create a web-based JSP report that automatically opens in Excel within the browser. I created the template using Excel, saved this as a web page, opened this in Reports Builder, etc. Once I complete the report in Reports Builder and save it as a Reports JSP, I can successfully run this within Reports Builder using the "Run Web Layout" feature. The problem is when I try to run this JSP within my web-application in JDeveloper using the in-line reports server. The browser launches Excel, but then the ReportsTag.doStartTag() method throws a JspException (see below). Anyone seen this problem or been successful achieving this? I have a normal web-based JSP report that is running fine within JDeveloper using the reports in-line server. Also, the only way I could get my web/paper-based report to be generated in PDF format and Paginated HTML was to start a separate reports server and submit my report to the rwservlet of this server. Shouldn't I be able to use the in-line server in JDeveloper? Any help or ideas would be greatly appreciated. Thanks!
    Exception I'm getting from Excel Report: javax.servlet.jsp.JspExceptionjavax.servlet.jsp.JspException
    at oracle.reports.jsp.ReportTag.doStartTag(ReportTag.java:341)
    at jsp.reports._schedule._Excel._jspService(_Excel.java:58)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
    at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)

    Hi Bill
    Let me clarify your doubts. You can use in-process Reports server with report servlet as well as from the jsp engine. The difference here is really on what Reports you can actually run from Reports servlet and jsp engine.
    For running from Report servlet:
    http://xx.x.xx.xxx:9004/reports/rwservlet?reports=...
    You would be using report definition file [rdf/jsp] which have paper layout information included in definition. You can run these paper reports to pdf/html/rtf/delimited/delimitedata format.
    Runnig a reports from jsp engine:
    http://xx.x.xx.xxx:9004/reports/examples/<reports_name.jsp>?server=...+userid=...
    You would be running a report definition [jsp/xml] which have reports jsp tags as part of reports web layout information. Please note these web layout reports which you mention using reports jsp tags, are run under the jspengine using reports tag libraries. The only format you can generate here is html [or excel output].
    Reports in-process server is a concept where if user has not started a exclusive Report server, Report servlet, and also reports tag libraries, would start a default reports server to run the particular request. This way it would make things easy for the user and he would need to manage a seperate report server of it own.
    Thanks
    Rohit

  • Need Assistance for VBA function in oracle how to implement

    My very respected and Senior, regards,
    Sir, hope you will in best of health and wealth by the grace of God,
    Sir, i have a request problem as i m very junior against you and you have passed this time before many years ago as i m standing where. Sir i m a very junior developer of oracle and have a problem putting on your desk with the hope that you can help my as a boss.
    Sir me have to calculate yield of Bond using oracle form
    i have tried my best and tired
    there is a formulae in excel which give the Yield() when we provide the parameters
    and i need the excel formulae or the oracle calculation code of PLSQL for this.
    How can i get yield when i have price, coupon rate, frequency, issue and maturity of the coupon , coupon period , next coming coupon , and others detail.
    or tell me how to use EXCEL VBA for this problem ,
    thnx n regards,
    yours student, junior developer youngest brother
    Faraz
    How can I get the solution using Excel VBA function with oracle
    so that move values to excel calculate them and copy the result from excel to oracle forms

    Hi,
    for the Hex-Number-conversion see:
    [url http://psoug.org/snippet/Convert-Hex-to-Decimal-Decimal-to-Hex_78.htm] self-defined Conversion-Functions
    What number format do you have? YYYMMDD
    Or is there a Date corresponding to 1 and a number n represent the date n-1 days after day 1?
    Please describe further.
    Bye
    stratmo

Maybe you are looking for