Q

Creating a "wrap text" format in Excel VBA

How to create columns, also known as wrap text, in Excel VBA.

Is there any way to programmatically create an Excel spreadsheet defining a column with "wrap text" format? I have

searched the SAP library, but the results were discouraging.

In Excel VBA, to set a column, e.g., D to "Wrap Text", you use:

Columns("D:D").WrapText = True

To do this in ABAP, you'd need to create an OLE Excel object, using (omitting definitions) something like:

CREATE OBJECT o_wks 'Excel.Application' NO FLUSH. 
GET PROPERTY OF o_wks 'Range' = o_rng1 NO FLUSH exporting #1 = 'D:D'. 
SET PROPERTY OF o_rng1 'WrapText' = '1'.
This was first published in November 2006

Dig deeper on SAP workflow development

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close