TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Keith
NA
13
0
Method() is inaccessible due to its protection level
Jan 31 2014 4:50 PM
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!
Reply
Answers (
2
)
How to read PDF file in C#
Microsoft.Office.Interop.Owc11 is not working for windows 7