Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE and Excel

Status
Not open for further replies.

bigbillmac

Programmer
Jan 31, 2005
24
GB
Hi Guys,

I hope there are some Excel experts out there.

I need to create Excel 2000 worksheets from inside a PB App (v10.2) and I thought this would be straightforward!!!!

So read the documentation - which makes very little sense. OK let's try another tack.

Browse around this here new-fangled interwebnet and lo and behold I find the "10 minute solutions" on the DevX site and a really useful article at:
Thank you Ken Howe this is an excellent little article.

I manage to get the example working perfectly and very soon I am adapting it for my own requirements. Doing things like offsetting the row and column number so you can place the data anywhere and other obvious things like this.

Until! I want to set a number format for a complete column. So I follow Ken's advice and create a macro which gives the following macro code:
Columns("G:G").Select
Selection.NumberFormat = "#,##0.00"

So I try converting this to PB code and below is a simplified version of what I did (in fact I wrote it as a function in a service object but when this did not work I simplified it to the code below):

lole_Sheet.Columns("G:G").Select
lole_Sheet.Selection.NumberFormat = "#,##0.00"

and this GPFs on the second line.

Anyone got any ideas?


Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top