>I've said before that the textbook "Microsoft Office Automation with Visual Foxpro" by our Tamar Granor and Della Martin is one of the most useful technical books I've bought.
>I do a lot of Excel automation with .NET. Many customers want their invoices transmitted via email or FTP in Excel format. Usually they require a format dictated by the A/P system they're using and some of those systems can be pretty finicky.
>Since my customer can't get paid till I get it right, I usually give these projects high priority.
>Excel has an annoying way of displaying 25.20 as 25.2 as a default and some systems won't accept that.
>I vaguely remembered a way to format cells to get that trailing zero, but I couldn't remember the exact syntax.
>Googling was no help, so I looked at that 23 year old book and sure enough the exact case I wanted to handle was there.
>Translating the VFP to C# was simple.
>
>
>
> // Tax formatting
> Excel.Range taxrange = (Excel.Range)xlWorkSheet.get_Range("D2", "D" + reportsDs.view_guessbillingsummary.Rows.Count + 1.ToString().TrimEnd().TrimStart());
> taxrange.NumberFormat = "###,###,###.#0";
>
>
Thanks, Bill. Full disclosure: Della wrote the Excel chapters.
Tamar