ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   applying column formatting programatically (https://www.excelbanter.com/excel-programming/369173-applying-column-formatting-programatically.html)

LadyReader

applying column formatting programatically
 
I have:

ws.range("J").NumberFormat = "0%"

and

ws.range("K").NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($*
""-""??_);_(@_)"

where ws is dim'd as a worksheet
This formatting code lines are copied from a VB6 program. However, I
am coding in VB.net (VS2003) and they are giving me runtime errors:

System.Runtime.InteropServices.COMException (0x800A03EC): Exception
from HRESULT: 0x800A03EC.
at Microsoft.VisualBasic.CompilerServices.LateBinding .LateGet(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)

Can anyone explain to me what's going on and show me the proper syntax
for formatting the Excel worksheet objects in VB.net?

Thank you.



All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com