Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

OLE Excel quit without save

$
0
0

Hi all.

I'm reading an Excel file with OLE.

I'm trying to close it without the annoying message to save changes (modified copy of ALSM_EXCEL_TO_INTERNAL_TABLE).

 

The WORKBOOK class has a CLOSE method with a parameter called SAVECHANGES.

This parameter is of type BOOLEAN.

 

general code i've used:

 

  call method of workbook 'CLOSE' EXPORTING #1 = space.  CALL METHOD OF application 'QUIT'.  FREE OBJECT h_cell.       m_message.  FREE OBJECT h_cell1.      m_message.  FREE OBJECT range.        m_message.  FREE OBJECT worksheet.    m_message.  FREE OBJECT workbook.     m_message.  FREE OBJECT application.  m_message.

 

 

I've tried 0, -1, and other values instead of SPACE, but i keep getting an OLE error.

Does someone know how to call this method with the VBA-equivalent of a BOOLEAN parameter?  ABAP type BOOLEAN is CHAR1, which is not the same.

 

Thanks.

Jester


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>