Hi Patrick,
I got this answer somewhat earlier on an Excel newsgroup, and it works fine.
Thanks very much!
Bernie
"Patrick Penet" <(E-Mail Removed)> wrote in message
news:403877b9$0$5915$(E-Mail Removed)...
> Hi Bernie,
> You should add a ' as the first char of the values you
> pass to Excel, it then will be seen as a string.
> OTH
> Patrick Penet
>
>
> "Bernie Yaeger" <(E-Mail Removed)> a écrit dans le message de
news:eNftOPD%(E-Mail Removed)...
> > I'm using the following function (I'm displaying the guts of it only) to
> > convert a datatable to an excel spreadsheet:
> >
> > For Each mrow In dt.Rows
> > rowindex += 1
> > colindex = 0
> > For Each col In dt.Columns
> > colindex += 1
> > objws.Cells(rowindex, colindex) = mrow(col.ColumnName).ToString()
> > Next
> > Next
> >
> > This works fine, but if there's a string which looks like a number,
prefix
> > '0's are dropped - eg, '07' become '7'. Is there any way to avoid this
and
> > have the .xls file display '07'?
> >
> > Thanks for any help.
> >
> > Bernie Yaeger
> >
> >
>
>
|