Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
Method() is inaccessible due to its protection level
Keith
Jan 31 2014 4:50 PM
5.5k
Reply
Hi All,
I'm only self taught (as most are I'm sure), but I only deal with small apps to help out at work. I'm reading data from an Access Database, performing my report functions on it, and saving it to Excel. This all works fine, but I am trying to format the column width in the spreadsheet, but receive the error
'System.Data.Range' is inaccessible due to its protection level
in the following code:
public void
SetColumnWidth(Excel.
Worksheet
ws,
int
col,
int
width)
{
((Range)ws.Cells[1, col]).EntireColumn.ColumnWidth = width;
}
I'm sure you will need more information, but I'm unsure what. If you can tell me I'll post it ASAP.
Thanks is advance!
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
How to read PDF file in C#
Microsoft.Office.Interop.Owc11 is not working for windows 7