Want to select all rows and cols in OWC Spreadsheet

S

stocki

Hi,

at the end of the day I want to make an "AutoFit" over all cols and
rows of a OWC11 spreadsheet. I am digging for quite some time now,
without finding a solution. I tried something like:

axSpreadsheet1.get_Range(axSpreadsheet1.Cells[1, 6],
axSpreadsheet1.Cells[6, 6]).Columns.AutoFit() ;

which works fine for the range mentioned. Of course I can write
Cells[65536, 256] instead of Cells[6, 6], which would only be a
suboptimal solution.

I should mention that this OWC spreadsheet is embedded in a Windows
form and I am using C#.

Ideas are highly appreciated!

Cheers

Stocki
 
J

Josh Sale

Stocki,

A statement like

wrksheet.Cells.Select

will select all of the cells on the worksheet. So how about:

wrksheet.Cells.Columns.AutoFit
wrksheet.Cells.Rows.AutoFit

josh
 
S

stocki

Stocki,

A statement like

wrksheet.Cells.Select

will select all of the cells on the worksheet. So how about:

wrksheet.Cells.Columns.AutoFit
wrksheet.Cells.Rows.AutoFit

josh


at the end of the day I want to make an "AutoFit" over all cols and
rows of a OWC11 spreadsheet. I am digging for quite some time now,
without finding a solution. I tried something like:
axSpreadsheet1.get_Range(axSpreadsheet1.Cells[1, 6],
axSpreadsheet1.Cells[6, 6]).Columns.AutoFit() ;
which works fine for the range mentioned. Of course I can write
Cells[65536, 256] instead of Cells[6, 6], which would only be a
suboptimal solution.
I should mention that this OWC spreadsheet is embedded in a Windows
form and I am using C#.
Ideas are highly appreciated!

Stocki

Hi Josh,

brilliant! I was thinking a little bit to complicated, I think!

Thank you !

Cheers

Stocki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top