+ Reply to Thread
Results 1 to 4 of 4

VBA to open an item in a table by using text instead of cell count

Hybrid View

  1. #1
    Registered User
    Join Date
    05-08-2014
    MS-Off Ver
    Excel 2003
    Posts
    8

    VBA to open an item in a table by using text instead of cell count

    Hi Guys,

    I am trying record a macro to open an item in a table.

    I want to open the last item "TEST RB RC". How will i open it by using a text "TEST RB RC" and not cell count?
    What appears on the script after the recording is the cell count and not the text. I tried replacing " 816" to "TEST RB RC" but its not working.

    Please help!


    If Not IsObject(application) Then
       Set SapGuiAuto  = GetObject("SAPGUI")
       Set application = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(connection) Then
       Set connection = application.Children(0)
    End If
    If Not IsObject(session) Then
       Set session    = connection.Children(0)
    End If
    If IsObject(WScript) Then
       WScript.ConnectObject session,     "on"
       WScript.ConnectObject application, "on"
    End If
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/usr/ssubSUB_CUST:SAPLRHUZ:0400/cntlTREE/shellcont/shell").selectItem "        816","ORG_STEXT"
    session.findById("wnd[0]/usr/ssubSUB_CUST:SAPLRHUZ:0400/cntlTREE/shellcont/shell").ensureVisibleHorizontalItem "        816","ORG_STEXT"
    session.findById("wnd[0]/usr/ssubSUB_CUST:SAPLRHUZ:0400/btn%#AUTOTEXT006").press
    Please check the attachment.

    Thanks! screenshot.jpg
    Last edited by Leith Ross; 05-09-2014 at 11:46 AM. Reason: Added Code Tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644
    What application is this for, SAP?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-08-2014
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA to open an item in a table by using text instead of cell count

    Yes Norie. For SAP.

    i attached the screenshot above.

  4. #4
    Registered User
    Join Date
    05-08-2014
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA to open an item in a table by using text instead of cell count

    Need help! :S

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 03-28-2014, 07:04 AM
  2. UserForm: Search Item in List > Call Table associated with Item > Execute Command
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2014, 12:58 PM
  3. Replies: 4
    Last Post: 09-15-2010, 08:45 PM
  4. linking a list item or text item in a user form to a worksheet
    By ravergirl7216 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-03-2010, 03:43 AM
  5. How To Add "Count" as a Column Item In Pivot Table
    By fredmeister in forum Excel General
    Replies: 5
    Last Post: 09-25-2008, 09:11 AM

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