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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Excel Cell properties from VB6.0

Status
Not open for further replies.

jake007

Programmer
Jun 19, 2003
166
US
Is there a way to set the cell properties for individual cells as they are exported.

Things such as Cell Width, Formatting(Currency, number, text).

An help would be appreiciated.
 
In a word, Yes.
Code:
With MyExcelApp.ActiveSheet.Cells(1,1)
  .NumberFormat = "#,##0.00"
  .Width = 40
End With
For example.


Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"A computer program does what you tell it to do, not what you want it to do." -- Greer's Third Law
 
No problem, jake.

Andy
"Logic is invincible because in order to combat logic it is necessary to use logic." -- Pierre Boutroux
"A computer program does what you tell it to do, not what you want it to do." -- Greer's Third Law
 
Now I am getting the error,

"Unable to set the width property of the range class"

Any ideas...

jake
 
ok, fixed it, it was .columnwidth, not .width.

Does anyone no of a reference anywhere that shows all of the properties that can be set for an excel spreadsheet?

Thanks again


jake
 
Best detail I've found is in VBHelp for Excel. Just open the VB Editor window (Alt F11) then open Help

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top