Skip to Content
avatar image
Former Member

worksheet in basis(1) excel is not generating and excel went to not responding state.

All your codes are really awesome. I learned a lot of new things from you and trying to explore more from you.

Am using your below code in my Excel VBA module which was posted on Nov 8, 2013 to download excel in XXL format from SAP.

'Here follow the new commands.
SAP_Workbook = "worksheet in basis (1)"
EXCEL_Path = "z:\tmp\"
myWorkbook = "myWorkbook.xlsx"
on error resume next
do
err.clear
Set xclApp = GetObject(, "Excel.Application")
If Err.Number = 0 Then exit do
'msgbox "Wait for Excel session"
wscript.sleep 2000
loop
do 
err.clear
Set xclwbk = xclApp.Workbooks.Item(SAP_Workbook)
If Err.Number = 0 Then exit do
'msgbox "Wait for SAP workbook"
wscript.sleep 2000
loop
on error goto 0
Set xclSheet = xclwbk.Worksheets(1)
xclApp.Visible = True
xclapp.DisplayAlerts = false

xclapp.ActiveWorkbook.SaveAs EXCEL_Path & myWorkbook 
xclapp.ActiveWorkbook.Close
Set xclwbk = Nothing
Set xclsheet = Nothing
'xclapp.Quit
set xclapp = Nothing

https://archive.sap.com/discussions/thread/3450067

It worked well previously, now am facing one issue in this.

"Save the data in the spreadsheet" dialog box pops up , and script halts and the worksheet in basis(1) excel is not generating and excel went to not responding state.

And suggestion or solution to overcome this will be really helpful.

Thanks in advance,

Jagadesh K.

Add comment
10|10000 characters needed characters exceeded

  • To do this, you would now need to see the script you have recorded yourself via the SAP GUI script recorder. You start recording at the point where your data is to be transported to Excel and stop when you have appeared in Excel. You have to publish the recorded script and then we will see further.

  • Former Member
    session.findById("wnd[0]").sendVKey 16
    session.findById("wnd[1]/usr/cmbG_LISTBOX").setFocus
    session.findById("wnd[1]/usr/cmbG_LISTBOX").key = "08"
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").select
    session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[0,0]").setFocus
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    

    After executing these lines the export file is not appearing and stops in the below image.

    capture.jpg (15.0 kB)
  • Get RSS Feed

0 Answers