2007 Aug 28 5:03 AM
dear all,
these code can work at excel 2003 but cant work at excel 2000,pls give me some
help,Thanks so much.
create object g_excel 'EXCEL.APPLICATION'.
CALL METHOD OF g_excel 'Workbooks' = g_WORKBOOK.
CALL METHOD OF g_WORKBOOK 'Add'.
CALL METHOD OF g_excel 'Worksheets' = g_SHEET
EXPORTING #1 = 1.
CALL METHOD OF g_SHEET 'Activate'.
set property of g_excel 'Visible' = '1'.
dear all,
these code can work at excel 2003 but cant work at excel 2000,pls give me some
help,Thanks so much.
create object g_excel 'EXCEL.APPLICATION'.
CALL METHOD OF g_excel 'Workbooks' = g_WORKBOOK.
CALL METHOD OF g_WORKBOOK 'Add'.
CALL METHOD OF g_excel 'Worksheets' = g_SHEET
EXPORTING #1 = 1.
CALL METHOD OF g_SHEET 'Activate'.
set property of g_excel 'Visible' = '1'.
2007 Aug 28 6:40 AM
Dear all,
I have resolved it myself, share my experience
for excel 2003
set property of g_excel 'Visible' = '1'. and set property of g_excel 'Visible' = 1.
are same but
for excel 2000
only set property of g_excel 'Visible' = 1
is right.
FYI
2007 Aug 28 7:30 AM
Hello,
This is what i normally do on Excel 2000
CREATE OBJECT excel 'EXCEL.APPLICATION'.
IF sy-subrc NE 0.
WRITE: / 'No EXCEL creation possible'.
STOP.
ENDIF.
SET PROPERTY OF excel 'DisplayAlerts' = 0.
CALL METHOD OF excel 'WORKBOOKS' = workbook .
* SET PROPERTY OF excel 'VISIBLE' = 1.
* creating workbook
SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
CALL METHOD OF workbook 'ADD'.
* creating sheets
DO 3 TIMES.
IF sy-index GT 1.
CALL METHOD OF excel 'WORKSHEETS' = sheet.
CALL METHOD OF sheet 'ADD'.
FREE OBJECT sheet.
ENDIF.
ENDDO.
count = 0.
do 3 times.
count = count + 1.
CALL METHOD OF excel 'WORKSHEETS' = sheet
EXPORTING
#1 = count.
* setting the initial position of the index sheet
row = 1.
col = 1.
* naming and activating the index sheet
SET PROPERTY OF sheet 'NAME' = count.
CALL METHOD OF sheet 'ACTIVATE'.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |