on 01-10-2014 8:26 PM
Whenever i attempt to export a report from SAP to excel using VBA the script pauses because a windows dialog box opens that prompts the user to select a file name and location...As a work around to this issue i would like to select the columns, copy and paste them into excel. I have been successful in selecting all the columns
with session.
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "EBELP"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "BSART"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "WERKS"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "MATNR"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "TXZ01"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "BEDNR"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "AUFNR"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "NAME1"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "PMATN"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "AEDAT"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "ZSLFDT"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "MENGE"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "NETPR"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "STPRS"
.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectColumn "ZWEMNG"
end with
However, i cannot find the vkey to copy the data. Can anybody help?
Perhaps sendvkey 78
From the SAP Scripting API:
Possible values for the VKey parameter can be found in the table GUI_FKEY.
VKey | Keyboard Combination |
00 | Enter |
01 | F1 |
02 | F2 |
03 | F3 |
04 | F4 |
05 | F5 |
06 | F6 |
07 | F7 |
08 | F8 |
09 | F9 |
10 | F10 |
11 | Ctrl+S |
12 | F12 |
13 | Shift+F1 |
14 | Shift+F2 |
15 | Shift+F3 |
16 | Shift+F4 |
17 | Shift+F5 |
18 | Shift+F6 |
19 | Shift+F7 |
20 | Shift+F8 |
21 | Shift+F9 |
22 | Shift+Ctrl+0 |
23 | Shift+F11 |
24 | Shift+F12 |
25 | Ctrl+F1 |
26 | Ctrl+F2 |
27 | Ctrl+F3 |
28 | Ctrl+F4 |
29 | Ctrl+F5 |
30 | Ctrl+F6 |
31 | Ctrl+F7 |
32 | Ctrl+F8 |
33 | Ctrl+F9 |
34 | Ctrl+F10 |
35 | Ctrl+F11 |
36 | Ctrl+F12 |
37 | Ctrl+Shift+F1 |
38 | Ctrl+Shift+F2 |
39 | Ctrl+Shift+F3 |
40 | Ctrl+Shift+F4 |
41 | Ctrl+Shift+F5 |
42 | Ctrl+Shift+F6 |
43 | Ctrl+Shift+F7 |
44 | Ctrl+Shift+F8 |
45 | Ctrl+Shift+F9 |
46 | Ctrl+Shift+F10 |
47 | Ctrl+Shift+F11 |
48 | Ctrl+Shift+F12 |
70 | Ctrl+E |
71 | Ctrl+F |
72 | Ctrl+/ |
73 | Ctrl+\ |
74 | Ctrl+N |
75 | Ctrl+O |
76 | Ctrl+X |
77 | Ctrl+C |
78 | Ctrl+V |
79 | Ctrl+Z |
80 | Ctrl+PageUp |
81 | PageUp |
82 | PageDown |
83 | Ctrl+PageDown |
84 | Ctrl+G |
85 | Ctrl+R |
86 | Ctrl+P |
Thanks
Sayuti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.