Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi i declared code to display the excel to export after exporting the code i am exit the application even also the memory leak in the task manager it is not at closing excel file which is exporting by this im facing the problem in two ways
one is not allowing to open file to other files some times it is facing
another is eating the lot of memory
in this i am addiontaly declared the code is
C#
public void SetCellValueToTextOnActiveSheet(int row, int col, object val)
         {
             //Rng.NumberFormat = "Text";
             Rng.NumberFormat = "###0";
             Rng.Value2 = Convert.ToString(val);
         }

which is for to convet the excel file number which are big will not display as it is so i convertd into it as text
and in the main class i declared it as
C#
if (Dt.Columns[j].ColumnName == "Serial In" || Dt.Columns[j].ColumnName == "Serial Out")
                            {
                                Xl.SetCellValueToTextOnActiveSheet(2 + i, 1 + j, Row[j].ToString());
                            }
                            else
                            {
                                Xl.SetCellValueOnActiveSheet(2 + i, 1 + j, Row[j].ToString());
                            }
                        }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900