View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Formatting Cells/Columns in Excel 97

Look in excel in the menu data. Then Get External Data. This provides a
wizard for importing data into Excel. Since this appears to be a database,
then the information on field/data types will be automatically captured from
the database (more than likely - I don't have experience with the InterBase
database).

You can turn on the macro recorder while doing it manually to see the code
one would use in VBA.

Since you are doing this from Delphi, you could open an instance of excel
and run such a macro using OLE Automation.

Another way would be to open excel using OLE Automation, then write the data
from your program into the worksheet.

Another way would be to use ADO

Although VB based, this page illustrates sample code for putting data in
Excel using ADO:
http://www.erlandsendata.no/english/vba/adodao/



--
Regards,
Tom Ogilvy





"Daryl Ho" wrote in message
...
Actually I'm supposed to extract some data from an InterBase database
server (using Borland Delphi) and dump them into an excel file.

However the exported excel field requirements I was given stated all
these stuffs like Column A = GENERAL (Size 6), Column B = GENERAL (Size
4), Column C = TEXT (Size 20) etc. Thus it's somewhat like a fixed width
column excel file that my client can import into their own programs.

I'm just real puzzled if Excel 97 is able to format the columns to this
extent (fixed width and different field type) so I thought I had better
snoop around here first before I call them back.

Hope this clears up the air. Thanks!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!