applying column formatting programatically

L

LadyReader

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.
 

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