WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Format Excel Column


Question:

Can somebody give me an example how to format an Excel-Column to:
-no decimals
-use 1000 seperator

Answer:

This can be accomplished using OLE:

objXL = ObjectOpen("Excel.Application")
objXL.Visible = @TRUE
objWorkbooks=objXL.WorkBooks
objWorkbooks.Open("C:\temp\data\test.xls")
objColumns=objXL.Columns("A:A")
objColumns.Select

objSelection=objXL.Selection
objSelection.NumberFormat = "#,##0"

ObjectClose(objSelection)
ObjectClose(objColumns)
ObjectClose(objWorkbooks)
ObjectClose(objXL)

Message("Notice","Column A - format successfully changed")
exit



Article ID:   W16619
File Created: 2005:02:18:12:21:38
Last Updated: 2005:02:18:12:21:38