Set Excel column width

G

GeorgeM

I have Access producing a spreadsheet, all is working well except I would
like to preset a column width. The sample below fails on the last line;
'calc cash difference
strFormula = "=if(F" & RowNum & ">0, F" & RowNum & "-G" & RowNum &
",0)"
objSht.Cells(RowNum, "H") = strFormula

'hide the unnecessary
objSht.Columns("D").Hidden = True
objSht.Columns("I").Hidden = True

objSht.Columns("A").Width = 10
This last line produces error "Unable to set Width property of the Range
class", what am I doing wrong???
Any advice is much appreciated, George
 

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