+ Reply to Thread
Results 1 to 7 of 7

passing parameter to a ms query

  1. #1
    Registered User
    Join Date
    02-07-2006
    Posts
    26

    passing parameter to a ms query

    hi... im running excel from a remote program and i need to pass a parameter for a ms query, such as a primary key, ...
    the call for the excel is treated like a dos calling: excel.exe c://file.xls .. and it opens the file.xls.. but it has a ms query and i need to pass a primary key

    ideas?

  2. #2
    Nick Hodge
    Guest

    Re: passing parameter to a ms query

    You can pass parameters to an Excel query very simply either as hard coded
    values or from cells or, if a user is present, typed into boxes.

    I'm not sure how you will implement this in your scenario, maybe in the
    workbook_open() event, but here is a link to my site with the GUI
    implementation

    http://www.nickhodge.co.uk/gui/datam...taexamples.htm

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk


    "redf1re" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hi... im running excel from a remote program and i need to pass a
    > parameter for a ms query, such as a primary key, ...
    > the call for the excel is treated like a dos calling: excel.exe
    > c://file.xls .. and it opens the file.xls.. but it has a ms query
    > and i need to pass a primary key
    >
    > ideas?
    >
    >
    > --
    > redf1re
    > ------------------------------------------------------------------------
    > redf1re's Profile:
    > http://www.excelforum.com/member.php...o&userid=31258
    > View this thread: http://www.excelforum.com/showthread...hreadid=509317
    >




  3. #3
    Registered User
    Join Date
    02-07-2006
    Posts
    26
    thanx... but my problem is that i need the value not by typing or getting it from a cell.. i need to pass that value as i open excel ... understand what i mean? i need to pass the value outsite excel to the inside,
    my user wont type it inside excel but outsite, in that remote program

    well.... just to make clear im using a ERP from oracle called JDE (or One World), and im trying to pass this information from the jde to excel ...

  4. #4
    Registered User
    Join Date
    02-07-2006
    Posts
    26
    lets make it easier...
    how can i call excel from dos writing something on a cell ?? that would do

    something like c://excel.exe c://teste.xls "bla bla bla " in H9

  5. #5
    Registered User
    Join Date
    02-07-2006
    Posts
    26
    up

  6. #6
    Nick Hodge
    Guest

    Re: passing parameter to a ms query

    Explained how it is, only by writing an app that can open the workbook and
    pass the variable between the two. Certainly there is now way to pass a
    value into a cell via dos in Excel/VBA

    Have you considered doing it the other way? Extracting the data *into* the
    cell *from* the Excel workbook using ODBC/OLE DB/ADO?

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk


    "redf1re" <[email protected]> wrote in
    message news:[email protected]...
    >
    > lets make it easier...
    > how can i call excel from dos writing something on a cell ?? that would
    > do
    >
    > something like c://excel.exe c://teste.xls "bla bla bla " in H9
    >
    >
    > --
    > redf1re
    > ------------------------------------------------------------------------
    > redf1re's Profile:
    > http://www.excelforum.com/member.php...o&userid=31258
    > View this thread: http://www.excelforum.com/showthread...hreadid=509317
    >




  7. #7
    Tim Williams
    Guest

    Re: passing parameter to a ms query

    Create a WSH script to automate the launching of Excel, opening the workbook
    and inputting the value.
    You can control the WSH script by passing parameters when you shell it.

    Simple command line example here:
    http://cis.stvincent.edu/wsh/args.html

    --
    Tim Williams
    Palo Alto, CA


    "redf1re" <[email protected]> wrote in
    message news:[email protected]...
    >
    > lets make it easier...
    > how can i call excel from dos writing something on a cell ?? that would
    > do
    >
    > something like c://excel.exe c://teste.xls "bla bla bla " in H9
    >
    >
    > --
    > redf1re
    > ------------------------------------------------------------------------
    > redf1re's Profile:

    http://www.excelforum.com/member.php...o&userid=31258
    > View this thread: http://www.excelforum.com/showthread...hreadid=509317
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1