Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from szaboa on Jul 29 at 3:06 AM Hi ChrisW! Sorry for the late reply. Not from the control, but after choosing the specific layout the columns got into the requires sequence and I want to export the result. The exporting works fine, however the recorded macro record the rank of the layout, therefore if a new layout comes into the list, the result will be wrong. Thanks! Szaboa
| | | ---------------Original Message--------------- From: ChrisW_at_Work Sent: Thursday, July 16, 2015 2:39 AM Subject: How to Choose a Specific Layout by Name, Instead of ID? Hi Szaboa, Are you trying to export data from the control? If so, then I use this to get all the Column names then export the data. ' this is in VBA for excel 'NB this is for a different SAP screen to yours! '"=======" ' get the control type Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Type ' get the control name Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Name ' get the control object type. Important. Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Text Debug.Print "--------------" ' select all columns s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").SelectAll ' get all the column names into a collection Set A = s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").SelectedColumns ; the collection is zero based For i = 0 To A.Count 1 ' get first name sColumnName = A.Item(i) ' get the data for a row that column Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").GetCellValue(irow, sColumnName) Next '== Best wishes Chris | | Reply to this email to post your response. __.____._ | | szaboa Business Operations Administrator | | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |