Excel Cell Formating in Visual Basic 6.0

  • Thread starter ElanKathir .S.N
  • Start date
E

ElanKathir .S.N

Hi all !

How to Format a Excel Cell using Visual Basic 6.0?
I want to fix the column width and hight and i using Excel Object for
create the Excel Sheet.

Thanks & Regards

Elankathir,
B'lore,
India.
 
T

tinyjack

The Macro recorder is a good place to start when looking at things lik
this. I recorded the following:


Code
-------------------

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 03/05/2004 by tinyjack
'

'
Columns("A:A").ColumnWidth = 32.57
Rows("1:1").RowHeight = 72.75
End Sub

-------------------


But, as you are automating Excel from VB6 you will need to make sur
everything is fully referenced back to your Excel object.

T
 
B

Bob Phillips

As long as you have an Excel application object then you have access to the
Excel object model. So you need something like

xlApp.ActiveWorkbook.Activesheet.Columns("A:H").ColumnWidth = 14

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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