Hi
We did not recommend automation Office product at server side(e.g. ASP
page, DCOM....), because Office Product is designed as a desktop product
which is targeted at User Interactive operation.
INFO: Considerations for Server-Side Automation of Office (257757)
http://support.microsoft.com/default...B;EN-US;257757
For your scenario as below, can you post more code about how you achieve
the behavior below.
Because all the variable below seems to have nothing to do with the any
object in Excel application.
So I think you may try to check if there is any Excel Object interact with
the variable below.
Also you may try to isolate the problem one by one.
e.g.
strTV = dt.ToString
..
strTV = dt.Columns(y)
.....
strTV = dt.Columns(y).DataType.ToString
also you may try to store the dt.Columns(y).DataType.ToString date before
your automation Excel.
================================================== ==========================
=============
Using the dataset I figured I could return the schema from the
datatable to determine datatype and using the Excel Range property set
the datatype of a column, this prevents leading zeros from being lost
on our tag codes, release id codes, etc. by setting the numberformat to
"@" and other uses. Again, this all works fine and I am still
disposing properly. The issue arises in my detection of the datatype
itself.
When I use this code: ( I removed all other code as I commented it in
testing this issue ).
strTV = dt.Columns(y).DataType.ToString
================================================== ==========================
==============
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.