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?