Click here to Skip to main content
15,924,507 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: dropdown list Pin
Prasanta_Prince2-May-11 3:07
Prasanta_Prince2-May-11 3:07 
QuestionExporting of data in excel sheet to sql server through asp.net Pin
saigirish1-May-11 23:53
saigirish1-May-11 23:53 
QuestionSub report+crystal report Pin
Ramkumar_S1-May-11 18:56
Ramkumar_S1-May-11 18:56 
AnswerRe: Sub report+crystal report Pin
Ravi Sant3-May-11 0:13
Ravi Sant3-May-11 0:13 
Questioncrystal report [modified] Pin
Ramkumar_S29-Apr-11 21:39
Ramkumar_S29-Apr-11 21:39 
AnswerRe: crystal report Pin
Sandeep Mewara29-Apr-11 22:31
mveSandeep Mewara29-Apr-11 22:31 
AnswerRe: crystal report Pin
RaviRanjanKr29-Apr-11 23:21
professionalRaviRanjanKr29-Apr-11 23:21 
AnswerRe: crystal report Pin
Sandeep Mewara30-Apr-11 21:25
mveSandeep Mewara30-Apr-11 21:25 
QuestionFCK Editor Configurations Pin
CodingLover28-Apr-11 18:56
CodingLover28-Apr-11 18:56 
AnswerRe: FCK Editor Configurations Pin
Tarakeshwar Reddy29-Apr-11 11:32
professionalTarakeshwar Reddy29-Apr-11 11:32 
AnswerRe: FCK Editor Configurations Pin
Ravi Sant3-May-11 0:55
Ravi Sant3-May-11 0:55 
Questiondynamic Report Pin
Ramkumar_S28-Apr-11 15:18
Ramkumar_S28-Apr-11 15:18 
AnswerRe: dynamic Report Pin
thatraja28-Apr-11 15:55
professionalthatraja28-Apr-11 15:55 
AnswerRe: dynamic Report Pin
Prasanta_Prince29-Apr-11 6:13
Prasanta_Prince29-Apr-11 6:13 
QuestionRefresh gridview after update with autocomplete Pin
vanikanc28-Apr-11 7:43
vanikanc28-Apr-11 7:43 
AnswerRe: Refresh gridview after update with autocomplete Pin
vanikanc28-Apr-11 9:49
vanikanc28-Apr-11 9:49 
QuestioniTextsharp vs pdfbox Pin
gavindon28-Apr-11 4:43
gavindon28-Apr-11 4:43 
AnswerRe: iTextsharp vs pdfbox Pin
Prasanta_Prince28-Apr-11 4:56
Prasanta_Prince28-Apr-11 4:56 
AnswerRe: iTextsharp vs pdfbox Pin
Pete O'Hanlon28-Apr-11 8:02
mvePete O'Hanlon28-Apr-11 8:02 
GeneralRe: iTextsharp vs pdfbox Pin
gavindon28-Apr-11 8:12
gavindon28-Apr-11 8:12 
GeneralRe: iTextsharp vs pdfbox Pin
Pete O'Hanlon28-Apr-11 8:25
mvePete O'Hanlon28-Apr-11 8:25 
GeneralRe: iTextsharp vs pdfbox Pin
gavindon28-Apr-11 8:34
gavindon28-Apr-11 8:34 
GeneralRe: iTextsharp vs pdfbox Pin
Pete O'Hanlon28-Apr-11 8:36
mvePete O'Hanlon28-Apr-11 8:36 
QuestionUnable To Create Excel Sheet At Runtime In my Application. Pin
Sanket.Patil28-Apr-11 2:37
Sanket.Patil28-Apr-11 2:37 
Hi All,

I am developing a web application. In that I have a web page that imports the data from EXCEL SHEET To Database. While doing this I have set some validation over the EXCEL Data. If the data is incorrect i need to write it in a new excel file which is created at run time. I have written the code to create new excel file with some data. But While Creating The Excel File I am Getting an error which i am unable to solve.

So, Please Help me to solve my problem.
I am using VS 2008 with c#.
The Error is :
Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space.

• To make more memory available, close workbooks or programs you no longer need.

• To free disk space, delete files you no longer need from the disk you are saving to.


The Code I have Written is :

Excel.Application WRExcel = null;
            Excel.Workbooks WRwbs = null;


            Excel._Workbook WRwb = null;
            Excel.Sheets WRss = null;

            Excel._Worksheet WRws = null;
            object objOpt = System.Reflection.Missing.Value;

            if (System.IO.File.Exists("C:\\Excel1.xls"))
            {
                //Delete The Existing Excel Sheet
                System.IO.File.Delete("C:\\Excel1.xls");
            }
            //create Excel spreadsheet

            WRExcel = new Excel.Application();

            WRwb = WRExcel.Workbooks.Add(objOpt); // My Error Occurs Here

            WRss = (Excel.Sheets)WRwb.Worksheets;

            WRws = (Excel._Worksheet)(WRss.get_Item(1));

            //create Excel column headings

            WRws.Cells[1, 1] = "Part Number.";

            WRws.Cells[1, 2] = "Kit Part.";

            WRws.Cells[1, 3] = "Description";

            WRws.Cells[1, 4] = "Reason For Reject";


            WRws.Cells[2, 1] = RowNo.Trim();

            WRws.Cells[2, 2] = ColumnNo.Trim();

            WRws.Cells[2, 3] = ErrorMsg.Trim();

            WRws.Cells[2, 4] = Filename;
            
            //save workbook

            WRwb.SaveAs("C:\\Excel1.xls", objOpt, objOpt, objOpt, objOpt, Opt,                 Excel.XlSaveAsAccessMode.xlNoChange, objOpt, objOpt, objOpt, objOpt, objOpt);

            //close workbook

            WRwbs.Close();



Please Help me to Solve My Problem.

Thanks & Regards
Sanket Patil
.

AnswerRe: Unable To Create Excel Sheet At Runtime In my Application. Pin
Prasanta_Prince28-Apr-11 3:02
Prasanta_Prince28-Apr-11 3:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.