We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] OLE and ABAP Open With Two Worksheets and Highlight Second

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from wnash7658 on Jun 7 at 6:00 AM
Resolved, when working with multiple sheets I had to use WA_SHEET instead of WA_MAP.

Regards
Waza

---------------Original Message---------------
From: wnash7658
Sent: Wednesday, June 06, 2012 7:20 AM
Subject: OLE and ABAP Open With Two Worksheets and Highlight Second

I have an excel file stored in SMW0 that is downloaded and opened. The second worksheet needs to be active and I pass the data into the excel and then activate the first worksheet and do the same thing. But I cannot seem to find the correct Excel OLE method to use. My code is below:-

* Handles for OLE objects
DATA: WA_EXCEL TYPE OLE2_OBJECT, " Excel object
WA_MAPL TYPE OLE2_OBJECT, " workbooks
WA_MAP TYPE OLE2_OBJECT, " workbook
WA_SHEET TYPE OLE2_OBJECT, " sheet
WA_BORDERS TYPE OLE2_OBJECT, " borders
WA_ROWS TYPE OLE2_OBJECT, " row
WA_ZL TYPE OLE2_OBJECT. " cell

* Check the templete file
PERFORM FRM_CHEK_DIRECTORY.
* Create a new applicationl
CREATE OBJECT WA_EXCEL 'EXCEL.APPLICATION'.
PERFORM FRM_ERR_HDL.
SET PROPERTY OF WA_EXCEL 'Visible' = 1. "open up for user to see download.
* get list of workbooks, initially empty
CALL METHOD OF WA_EXCEL 'Workbooks' = WA_MAPL.
* OPen template file
CALL METHOD OF WA_MAPL 'Open'
EXPORTING #1 = P_NAME.
IF SY-SUBRC NE 0.
MESSAGE S398(00) DISPLAY LIKE 'E' WITH TEXT-036.
LEAVE LIST-PROCESSING.
ENDIF.
* open Sheet.
CALL METHOD OF WA_MAP " Create wsheet object
'Worksheets' = WA_SHEET EXPORTING #1 = 'Brand'.
CALL METHOD OF WA_SHEET 'Activate'.

It is no activating the 'Brand' worksheet.

Regards


Waza

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
pretty lady ask a question
 
wnash7658  
SAP Specialist and Project Leader
24 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Toolbox.com for iPhone & Android: Ask Questions & Get Answers Anywhere. Download the Free App

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language