I'm just making my first steps with OLE and I encountered the following
problem:
Using Delphi 3 and OLE, I filled an Excel97 sheet with data. Now I would
like to change the format of some columns to 'Date' or 'Time', but I
didn't find any Helpfile, solving that problem.
But I'm quite sure: It can't be so difficult !!!
Has anyone an idea ???
After you have attached to Excel and selected the target cells, try the
following,
ExcelApp.Selection.NumberFormat := 'm/d/yy';
where ExcelApp : OLEVariant; is assigned to the Excel application object.
Good Luck.
Dave Bergquist
Dino Ciotola <cio...@msmhdg.hoechst.com> wrote in article
<355075...@msmhdg.hoechst.com>...
1) Open Excel
2) Do Tools | Macro | Record New Macro...
3) Do whatever it is I want to automate (select column, right-click, Format
| Date, etc)
4) Stop the macro recorder
5) Do Tools | Macro | Macros...
6) Select the macro I just recorded and click Edit
This usually shows me exactly what I need, and if I need more info at that
point, I'll look at the Excel Help.