16,005,389 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 13818561 (Top 10 by date)
Member 13818561
8-Jun-18 4:22am
View
I am getting this error.
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType) at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj) at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Project1.WebForm1.READExcel(String path)
Member 13818561
8-Jun-18 3:09am
View
Actually the problem is references are not published while publishing the asp.net project. So what should I do?
Member 13818561
8-Jun-18 2:29am
View
I used this code.
Microsoft.Office.Interop.Excel.Application objXL = null;
//Workbook refrence
Microsoft.Office.Interop.Excel.Workbook objWB = null;
//DataSet ds = new DataSet();
//try
//{
//Instancing Excel using COM services
objXL = new Microsoft.Office.Interop.Excel.Application();
//Adding WorkBook
objWB = objXL.Workbooks.Open(path);
foreach (Microsoft.Office.Interop.Excel.Worksheet objSHT in objWB.Worksheets)
int rows = objSHT.UsedRange.Rows.Count;
int cols = objSHT.UsedRange.Columns.Count;
DataTable dt = new DataTable();
int noofrow = 1;
//If 1st Row Contains unique Headers for datatable include this part else remove it
//Start
for (int c = 1; c <= cols; c++)
{
string colname = objSHT.Cells[1, c].Text;
dt.Columns.Add(colname);
noofrow = 2;
}
//END
for (int r = noofrow; r <= rows; r++)
{
DataRow dr = dt.NewRow();
for (int c = 1; c <= cols; c++)
{
dr[c - 1] = objSHT.Cells[r, c].Text;
}
dt.Rows.Add(dr);
}
ds.Tables.Add(dt);}
Member 13818561
8-Jun-18 2:26am
View
Sir I have a doubt,
I wanted to convert from excel to dataTable. It works fine. But after publishing my project rest of all page works fine. But only this page code is not working. please give me suggestions.
Member 13818561
28-May-18 3:20am
View
Thank You so much sir. It works for me.
Member 13818561
18-May-18 2:27am
View
Thank you sir, Let me try
Member 13818561
18-May-18 2:10am
View
Ok thank you Sir, Let me try
Member 13818561
15-May-18 8:46am
View
Ok sir. thank you. Let me check.
Member 13818561
10-May-18 1:27am
View
Thank you sir for your reply.
But I have a condition. The textbox must appear for only one cell of particular row. For the remaining rows in a Gridview textboxes shouldn't appear. For example if I have 3 rows in a Gridview the text box must appear for only 1 row. Means In that row for only 1 cell.
Member 13818561
10-May-18 1:23am
View
Deleted
Thank you sir for your reply.
But I have a condition. The textbox must appear for only one cell of particular row. For the remaining rows in a Gridview textboxes shouldn't appear. For example if I have 3 rows in a Gridview the text box must appear for only 1 row. Means In that row for only 1 cell.
Show More