Passing values to and from Excel

All,
I am building a program to gather data from a force gauge via RS232. One of the requirements of the program is to have the user tell the program what sample they are on in case their samples are not in order. I also need to check my Excel sheet if that sample has already been tested. Some of my code in a module looks like this:
Function HasSampleBeenTested(dblSample As Double, strSG As String) As Boolean
' Finds out if the sample being tested has already been tested.
HasSampleBeenTested = False
Range("B14").Select
'First, find the Sample Group Number
Do Until ActiveCell.Value = ""
    If ActiveCell.Value = strSG Then
        ActiveCell.Offset(0, -1).Select
        Exit Do
    Else
        ActiveCell.Offset(1, 0).Select
    End If
Loop
' Next, find the actual sample
Do Until ActiveCell.Value = ""
    If ActiveCell.Value = strSample And ActiveCell.Offset(0, 1).Value = strSG Then
        HasSampleBeenTested = True
        Exit Do
    Else
        ActiveCell.Offset(1, 0).Select
    End If
Loop
End Function
I also have a diagram wired to this exact instance of Excel, but I'm not sure how to wire my type (boolean) and get the data out as a boolean via the Variant to Data VI.
Solved!
Go to Solution.
Attachments:
Diagram1.png ‏6 KB

There is no reason to actually have an Insert Into Array. The Build Array already gives you an array. The Excel Run Macro actually wants an array of variants, not an array of strings. The red coercion dot indicates that your array of strings is being converted to an array of variants. I'm not sure if the macro will actually received the Sample # correctly since you're converting it to a string. The safe bet would be to convert each value to a variant (using the To Variant function) and build an array from that to feed to the Excel Run Macro:
Attachments:
Example_VI_BD.png ‏2 KB

Similar Messages

  • Passing Values to and from a Javascript rule - Agentry

    Hi;
    I am working on determining the first day and last day of the week using a javascript rule, so this can be in turn passed to an Agentry date and time property. When I debug in the ATE, it seems my javascript rule is always returning zero. What could I be missing, please see below the rule implementation. I am using this rule on a transaction property, under the "Initial Value" attribute - before data entry:
    What could my rule be missing, How could I implement this correctly?
    Much appreciated!
    Sizo Ndlovu
    Tags edited by: Michael Appleby

    Hi Stephen;
    I have done as you advised, but I seem to be still getting a zero returned, please see below:
    The Javascript method return variable (curUnixTime -: as shown on the first screenshot), is it automatically returned onto the WeekEnd property or there is extra code/steps that I need to add?
    Thanks and Regards;
    Sizo Ndlovu

  • How to passing value into Captivate from html?

    How to passing value into Captivate from html?
    Or
    How to communicate between objects in one slides?

    Hi czhao0378 and welcome to the forums!
    Captivate does not natively allow you to communicate your own
    data, either internally or externally. The only way to make this
    happen is to create your own functionality, either via custom-built
    Flash objects or JavaScript code executed in the browser or a
    combination of both.
    The only example I've seen of any "data passing" inside
    Captivate is a custom text input/output solution that was posted on
    the Captivate Developer Exchange:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1253 021
    This solution consists of an input box that takes information
    from the user on one slide and a second box that displays that
    information on another slide. The functionality was built in Flash
    and is embedded in Captivate as a Flash "animation". Unfortunately,
    since this is a custom functionality, the information is not
    included in the user completion results Captivate can pass to a
    Learning Management System.
    Since the solution mentioned above relies on a Flash
    Actionscript variable to hold the information that is displayed,
    you can also pass the information from HTML to Captivate using the
    "SetVariable" command in JavaScript. This would at least allow you
    to display your own HTML-based data inside Captivate.
    Beyond that, I'm not aware of any other way to gather and
    pass data in Captivate.

  • Passing values to javascript from database

    hi friends,
    I have to fetch values from the database and pass the values to the java script variable.
    I tried this, but is not working. When i place the script inside the java, it isnt working. Iam passing value to this script variable as argument to a function. This is my code:
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next())
    for (int i = 1; i <= numberOfColumns; i++)
    count=count+1;
    if (i > 1)
    columnValue = rs.getString(i);
    %>
    <script>
    var hcbList = [<%=request.getParameter("columnValue")%>];
    </script>     
    <%           
    System.out.println("");
    st.close();
    %>
    Pls solve the problem. Its very urgent!
    thanx

    Keep this in mind: JSP is source generation software.
    In other words JSP generates the HTML and/or Javascript that will be rendered on the browser. So What you need to do is keep the JSP and Javascript separate in your mental picture. You ask yourself, "what would the finished Javascript code look like that would give me the results?" Then you apply JSP as a template to fill in the blanks. In your example you want a list or an array of values in your Javascript. I don't use Javascript to often but from memory I belive an array in Javascript is something like this:
    <script>
    var hcbList = {"val1", "val2, "valx"};
    </script>That's what the finished Javascript would look like. Now you apply JSP as a template.
    <!-- This is the fill-in-the-blank template
    <script>
    var hcbList = {<%=insertArrayHere%>};
    </script>Now you fill in the blanks
    //insertArrayHere is your blank
    String insertArrayHere = "";
    //iterate over the collection and build a string that represents the JS array
    for(int i = 1; i <= numberOfColumns; i++)
       //wrap each value with quotes if it is to be a JS string
       insertArrayHere += "\"" + rs.getString(i) + "\"" + ","; //terminate with a comma
    //trim the last comma off the array guts
    insertArrayHere = insertArrayHere.substring(0, insertArrayHere.length() - 1); Now I'm sure that's not exactly what you want because it looks like you got some crazyness going on in your logic. I don't know how you can query the using values from the database. Anyhow it poses as a good example of how to apply the concept of the two technologies. (Also, why are you doing a System.out from JSP? You should be calling log() if you want console output.) The whole idea is that JSP can NOT talk directly to Javascript. It can only generate Javascript dynamically before it is received by the browser.

  • Repeatly passing data to and from external program

    I'm looking for some help to get me started.  I'm willing to bet
    the info is here I'm just not sure what to look for and my searches
    aren't reveiling anwsers. 
    Background: I'm trying to take control of a device that is comunicating
    through the PCI bus.  The device has a set of API dll's that I can
    access through C++, but not directly in LabVIEW.  So wish to creat
    a wrapper program that will give LabVIEW indirect access to the
    dlls.  
    Problem: I've breifly read up on CINs and Libaray call functions and
    have found one underlying problem with both.  I have not found a
    way to pass data back and forth between the external code and LabVIEW
    once the external code is running.  I require an interactive
    conection between the two. 
    Any sugestions of what to search for would be greatly appreatiated, or even how to resolve my problem.
    Thank you.
    Don't get even, get odd!

    If the data buffers are owned by the driver and are updated asynchronously, you should expose that buffer to LabVIEW as a handle (simple int32 for the pointer to the buffer). This can then be passed to the wrapper code and checked (implements your polling). Remember that handling tasks in LV that should run in parallel is different from C++ however - you don't create threads, instead you should simply set up independent loops.
    I'm not sure what else to suggest since I don't fully understand what the API does or what the HW is doing, so feel free to post more information if you want more suggestions
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Excel connections failing after the move from XP to Win7 and from Excel 2007 to 2010

    We recently upgraded to Win7 from XP, and from Office 2007 to 2010.  Some of my packages that use CSV or Excel as sources are failing.  Has anyone else experienced this and, if so, is there a quick fix?
    I tried saving the excel source files to 2007 format, but that really doesn't seem to be an option since both 2007 and 2010 ostensibly use the same extension, viz., .xslx.
    Thanks in advance for any assistance.  I'd hate to have to rewrite some of these packages if there's an easy fix.
    We're running SQL 2008 R2 and I'm using BIDS 2008
    Christian Bahnsen

    Here's the error messages on the package that prompted this post:
    TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.
    Error at Data Flow Task [Excel Source [1]]: Opening a rowset for "Summary$" failed. Check that the object exists in the database.
    Error at Data Flow Task [SSIS.Pipeline]: "component "Excel Source" (1)" failed validation and returned validation status "VS_ISBROKEN".
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
     (Microsoft.DataTransformationServices.VsIntegration)
    BUTTONS:
    OK

  • Passing values to Jframe from JApplet

    Hi All,
    i need to open a frame when someone clicks on some particular part of an applet. also, i need to pass some values to that frame based on the region selected.
    Previusly i m doing it through showDocument method which calls a JSP which in turn calls the applet that i m trying to change as a frame now.
    Help please.
    Liza

    just to make things more clearer... i was passing values as querystring to JSP which passes them to an applet through parameter tags.
    Liza

  • Passing values to OnDemandProcess from Select Statement on Reports Page

    I think I'm just missing some of the proper syntax, Can somebody please help me.
    As I've come to understand this process of passing the values,
    I recognize it as (3) steps.
    1. Referencing the "javascript" in the Select Statement of the Reports Page.
    2. Including the "javascript" in the Page Header region.
    3. Defining the Process as an OnDemand Application Process.
    My problem is:
    a. I can't seem to get the Value passed to the Application Process.
    b. I don't know how to reference the Value passed once I get it passed.
    Here's what I've got done so far:
    1. (The Select Statement)
       onClick="javascript:ORDER_CONNECT_SEQUENCE('||ID||')
    {code}
    2. (The javascript)
    {code}
    function ORDER_CONNECT_SEQUENCE('+ID+')
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORDER_CONNECT_SEQUENCE',0);
    get.add('+ID+');
    gReturn = get.get('+ID+');
    {code}
    3. (The Application Process)
    {code}
       BEGIN
       Select '+ID+' into THIS_CIRCUIT from dual;
    {code}
    I Know that the Application Process is being referenced and that the OnClick routine is working properly,
    because if I plug a Value into the Application Process, instead of using '+ID+',
    Then I get all of my desired results.
    Any help you can give me here is greatly appreciated.
    Thanks- Gary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Dimitri, Thanks for your efforts here, but its still not working for me.
    Here's what I understand from your suggestions:
    1. (changes to the javascipt)
       a. replace function ORDER_CONNECT_SEQUENCE('+ID+')
           with
           function ORDER_CONNECT_SEQUENCE(pId)
       b. replace get.add('+ID+')
           with
           get.addParam('x01',pId)
       c. replace getReturn = get.get('+ID+')
          with
          getReturn = get.get()
          get = null2. (chages to the Application Process)
       a. add l_value varchar2(4000) to my list of declarations
       b. add l_value := wwv_flow.g_x01 below the begin statement
       c. I guess then I would reference the l_value like this:
           Select l_value into THIS_CIRCUIT from dual* Also, You didn't mention any changes in my Select statement in the Reports region of the page.
    FYI.
      onClick="javascript:ORDER_CONNECT_SEQUENCE('||ID||')
    {code}
      The 'ID' which I'm referencing here is an ID from the table which I'm querying.
    Am I misunderstanding you somewhere?
    Thanks- gary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing values to FM froma selection screen

    Hi Guys,
    I have a selection screen in which i have 'From' and 'To' input fields.Also using multiple select button i can select discrete values.In the function module they have a table type in the import param.
    Is it possible to send the  values within the range plus the discrete values selected? If yes, then please help.
    Thanks,
    tubai.

    Hi,
    You can below code:
      DATA: rt_ranges TYPE REF TO data.
      FIELD-SYMBOLS:  <fs_select> TYPE table,
                                <fs_wa>  TYPE ANY,
                                <fs_wa1> TYPE ANY.
      DATA: lt_select  TYPE TABLE OF rsdsselopt,
                wa_sel_opt TYPE rsdsselopt.
    Retrieve the data from the select option
      rt_ranges = wd_this->w_handler->get_range_table_of_sel_field(
                               i_id = 'SELECT' ).
    Assign it to a field symbol
      ASSIGN rt_ranges->* TO <fs_select>.
      IF NOT <fs_select> IS INITIAL.
        LOOP AT <fs_select> ASSIGNING <fs_wa>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-sign = <fs_wa1>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-option = <fs_wa1>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-low = <fs_wa1>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-high = <fs_wa1>.
          APPEND lwa_sel_opt TO lt_select.
        ENDLOOP.
      ENDIF.
    You then pass lt_select to your FM.
    Regards,
    Priya

  • Passing values to FG from program

    Hi all
           Please help me to sort this problem.I have to call a screen in the Function group from a report  program so I am using below code to call it.
    clear bdcdata_wa.
      bdcdata_wa-program = 'SAPLZSECURITIES'.
      bdcdata_wa-dynpro = '0300'. "where 300 normal screen
      bdcdata_wa-dynbegin = 'X'.
      append bdcdata_wa to bdcdata_tab.
      call transaction 'ZDOCS_SECURITIES' using bdcdata_tab.
    Now I have to access the values from the program in FG screen after calling the screen.So I used below code but it is not working.Please help me to sort it out.
    assign ('(ZCML_DOCS_SECURITIES)I_VDARL') to <fs_vdarl>."I_VDARL Structure
          if sy-subrc = 0.
            move <fs_vdarl> to i_vdarl.
          endif.
    Thank You.
    Regards
    Giri

    That would work if it's an include/form, and you read data from the main program. But I do not know if it can be used with a call transaction. Maybe the problem is that it is not the same LUW... But I am not sure.
    I can't see anyting wrong with the code itself.
    When debugging, is the field symbol <fs_vdarl> assigned?
    Can you use an export to memory instead?

  • Passing values in table from one component to another component in gp

    hai all,
      I have a table with 5 rows in a view in component1.I need to pass the values in the table from component1 to table in component2.Plz help me with coding of interface controller of both component.
    Thanks in advance
    regards
    Sharanya.R

    Hi,
    Here more than coding its mapping of your components are important to transfer data
    Ex:
    You need to have a public part that exposes the node which is bound to the table in COMPA.
    Then in COMPB you need to make COMPA as used COMP.
    Then you need to map the contexts between them.
    Once this is done . You will need to code if you want to iterate through the elements.
    Following Docs will help you get  a  clear understanding
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f727d100-0801-0010-4cbd-b0ad5c161945
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e1f4df00-0801-0010-6298-8fdf667bbd0f
    Regards
    Ayyapparaj

  • Passing values to jsp from html..

    Hi all,
    I have a jsp containing a selection list and need to pass the value to the java segment of the jsp. When reserching this, I've found some info where an html page was created, an initial jsp was saving the info (or bean was used) and then a third jsp displayed the data (using buttons). This is too many steps and I'm needing a way for the same jsp to display containing the selected option (simulating a refresh with the post when the drop down list is used). Is redirecting while setting and getting attributes all at once feasible/possible or is there a better direction or work around for this?
    Thanks in advance,
    Geoff-

    I would think submitting the page to itself, and setting hidden fields to signal that it is a resubmission, may be the way to go. If the new information being displayed is minimal, JavaScript may also work, by setting up an empty <div> or <span> and setting the innerHTML or innerText properties. The advantage of the JavaScript solution is it would be quicker, having the client do all the processing, but it also browser dependant.

  • Passing data to and from Comm Sub Vi with 2 loops

    Im sure this is simple, and I think Im stuck in vacation mode and cant wait the 4 more hours till I leave, but this is really bothering me. I have a pretty large Queued State Machine and within that machine I have some states which must communicate via the TCP/IP port. My servers are complete and made into Executables and work fine, however I want to leave my clients as sub vi's so that I can easily pass in and retreive data from them. They are designed with 2 while loops, one for sending the data and one for reading the data back. At the very least the read loop needs to remain in a loop to pick up unsolicited messages from my CAN server. However when I place these into my master QSM they hold up the process because of the loops executing. Now I have made a separate loop in my QSM for all my communication clients so the rest of the QSM runs but I cant pass data into these clients because they are stuck executing the loops internally and dont stop to pull in data.
    I should note that if I run my QSM to spawn the servers, then run my client as a separate VI rather than a sub and type my commands there then they execute perfectly.
    So if you can follow my crazy description what would be the best/cleanest way to circumvent this so I can get moving ahead. Thanks, Dave

    Dave,
    Would it work to use a queue to pass data from your main QSM loop to your communication loop? You could write the commands to the queue from your main QSM loop, and pick them up in the communication loop. They would then still run in parallel. Let me know if this works, or if you are looking for something else.
    Robert Mortensen
    Software Engineer
    National Instruments

  • Passing values as parameters from forms

    We are trying to use the On successful submission of a form area to forward to a report based on a value entered on the form.
    Is there a way to use a value from the form in the url?

    Here is the code I used. The code in bold allowed me to use the value entered on the form as a parameter for the report I am forwarding to.
    declare
    bidder_id number := 0;
    blk varchar2(10) := 'DEFAULT';
    begin
    bidder_id := p_session.get_value_as_number(p_block_name => blk,
    p_attribute_name => 'A_BIDDER_ID');
    go('PBR.SUM_REG_INFO.show?p_arg_names=pbr_bidder.bidder_id&p_arg_values='||bidder_id);
    end;

  • Best way to pass data to and from a fieldpoint unit

    Hello,
    I am just starting to play with a fieldpoint unit and I was wondering the best way to send and receive data with it.  We are setting up a pumping station and need to send the FP a setpoint and be able to read other sensor connected to it.  I know there are at least a few options such as data socket, publish data, shared variables and maybe tcp/ip.  But I was wondering as to the best/easiest option.
    Thanks

    For case #1, you wouldn't have to do anything special.  The setpoint would just remain at whatever value was last written to it by the host system (the one where you are at the controles).
    For something like #2, you would probably want an extra routine, such as read the timestamp of the shared variable, if the cFP sees that it is too old (whether that would be a minute, an hour, a day ....) then the code goes into a pump down routine.  Another possibility would be a watchdog type of shared variable.  The host system periodically increments a counter and sends it to a shared variable on the cFP.  If the cFP sees that the counter hasn't incremented in a given period of time, then it can assume a connection was lost and do the shutdown routine.
    Going with shared variables will definitely get you started quicker.  Good luck with your application.

Maybe you are looking for

  • Redeploy sender soap adapter 7.1

    We have PI 7.1 SP7 and expriencing many problems with the sender SOAP adapter the service registry works for us for all web services but from other applications like xmlspy and soapui we get messages of chace problems and unauthorized ( all cache che

  • Itunes library goes missing

    I have now had this problem for almost 2 weeks. My itunes library keeps disappearing. When I open up itunes I have no songs, podcasts or TV shows. All gone. I took my notebook to the Apple Store today and they had never seen anything like it before.

  • Content Canvas not displaying when form entered

    I have a form that has not been updated since 2009.  Some time between then and now the key block has stopped displaying when the form is entered.  I can get it to display if I do the previous item key.  I have tried setting the Raise on Entry to Yes

  • Configure return type: There was an error while invoking the operation

    This error only occurs when I pass parameters to Configure return type dialog As a follow on from http://forums.adobe.com/message/2663481 I am getting this in the log. !ENTRY com.adobe.flexbuilder.DCDService 4 1 2010-06-15 11:45:29.323 !MESSAGE Pleas

  • TS1550 This should be in the Lion OS section, how do I find that?

    I have a 2 TB Seagate external drive and it is partitioned in 3 sections; 500 GB for my backup clone, 500 GB for Time Machine and 1 TB for extraneous extras.  For some reason the TM backup failed today, now what?