.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Excel cannot complete this task with available resources??error..C# Automation

Posted By: Sreeraj Nair Mungath     Posted Date: July 17, 2012    Points:5   Category :C#
Excel cannot complete this task with available resources??error..
choose less data or close appliction...

Exception from HRESULT: 0x800A03EC



public object UploadFiles(string filename,string sheetName)
{


wkb = excel.Workbooks.Open(filename, true, Type.Missing);///////error line




sheet = wkb.Worksheets[sheetName];
colcount = sheet.UsedRange.Columns.Count;
rowcount = sheet.UsedRange.Rows.Count;
Excel.Range range = sheet.Range[sheet.UsedRange.Columns.Address];
datarange = range.Value;
wkb.Close();
excel.Quit();
return datarange;
}


Responses
Author: Narayanan             
Posted Date: August 03, 2012     Points: 20   

Hi,
Please explain How did you call your method in your Program?




Regards, Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
Author: Deco             
Posted Date: August 06, 2012     Points: 20   

Please make sure the excel file you try to open is closed. If you try to open a excle file which is already opened in your machine, you would probably get this error.

Regards,
Deco


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend