Click here to Skip to main content
15,887,812 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error after selecting text in richtextbox Pin
Luc Pattyn6-Jul-09 0:26
sitebuilderLuc Pattyn6-Jul-09 0:26 
QuestionReport Viewer Control - Pin
devvvy5-Jul-09 20:25
devvvy5-Jul-09 20:25 
Questionhow to get only time from datetime? Pin
swetha_insoft5-Jul-09 20:22
swetha_insoft5-Jul-09 20:22 
AnswerRe: how to get only time from datetime? Pin
SeMartens5-Jul-09 20:26
SeMartens5-Jul-09 20:26 
AnswerRe: how to get only time from datetime? Pin
Anubhava Dimri5-Jul-09 20:41
Anubhava Dimri5-Jul-09 20:41 
AnswerRe: how to get only time from datetime? Pin
himanshu25615-Jul-09 20:44
himanshu25615-Jul-09 20:44 
AnswerRe: how to get only time from datetime? Pin
stancrm5-Jul-09 20:56
stancrm5-Jul-09 20:56 
Questionhow to write in excel cells using DataReader if a particular cell is “ReadOnly” using C# Pin
Krishna Aditya5-Jul-09 20:20
Krishna Aditya5-Jul-09 20:20 
Hi Guys,

I tried a lot to figure out how to skip writin onto a particular excel cell using C#, but couldnt get the proper logic.

my eg:
*Team Leader (required)     abcxyz     User1     user2
Customer Interface Focal     dfgidf     user23     user3*

each of the names above has to be in a particular cell... but in the excel template, first cell (Team Leader (required)) is readonly, so i cant write into that cell, so my final excel sheet should show

                                          abcxyz     User1     user2
Customer Interface Focal     dfgidf     user23     user3.....
.....

i tried various logics for this... please see the code below

1. Microsoft.Office.Interop.Excel.Workbook   SelWorkBook = excelappln1.Workbooks.Open(curfile,
      0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", true, false, 0, false, false, false);
     
      Microsoft.Office.Interop.Excel.Sheets      excelSheets =      SelWorkBook.Worksheets;
     
      Microsoft.Office.Interop.Excel.Worksheet      excelworksheet =      (Microsoft.Office.Interop.Excel.Worksheet)excelSheets.get_Item(CurSheetName);
     
      Microsoft.Office.Interop.Excel.Range      excelRange =      excelworksheet.UsedRange;

if ((!excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL + minCol]).Locked)
   {

            // Assigning the Value from reader to the particular cell in excel sheet excelworksheet.Cells[CurTaskNode.DATA_MIN_ROW + minRow, CurTaskNode.DATA_MIN_COL +         minCol] = values[iValueIndex];
            iValueIndex++;
   }




but the error shows, in the if statement
Error     1     Operator '!' cannot be applied to operand of type 'object'

so, please say how to handle this case.

Thanks
Ramm
AnswerRe: how to write in excel cells using DataReader if a particular cell is “ReadOnly” using C# Pin
dan!sh 5-Jul-09 20:51
professional dan!sh 5-Jul-09 20:51 
GeneralRe: how to write in excel cells using DataReader if a particular cell is “ReadOnly” using C# Pin
Krishna Aditya5-Jul-09 20:57
Krishna Aditya5-Jul-09 20:57 
GeneralRe: how to write in excel cells using DataReader if a particular cell is “ReadOnly” using C# Pin
dan!sh 5-Jul-09 21:10
professional dan!sh 5-Jul-09 21:10 
QuestionC# + MS ACCESS application - daily report problems Pin
daydr3am3r5-Jul-09 19:34
daydr3am3r5-Jul-09 19:34 
Question[Message Deleted] Pin
Bimal's5-Jul-09 19:30
Bimal's5-Jul-09 19:30 
AnswerRe: Making copy of a FILE Pin
Baeltazor5-Jul-09 19:38
Baeltazor5-Jul-09 19:38 
AnswerRe: Making copy of a FILE Pin
Mycroft Holmes5-Jul-09 19:42
professionalMycroft Holmes5-Jul-09 19:42 
AnswerRe: Making copy of a FILE Pin
himanshu25615-Jul-09 19:44
himanshu25615-Jul-09 19:44 
QuestionFinding usages of classes from a reference in Visual Studio (C#) Pin
Bijesh5-Jul-09 18:42
Bijesh5-Jul-09 18:42 
QuestionLink textbox to postgresql database Pin
daffy_20035-Jul-09 17:03
daffy_20035-Jul-09 17:03 
AnswerRe: Link textbox to postgresql database Pin
dan!sh 5-Jul-09 18:08
professional dan!sh 5-Jul-09 18:08 
QuestionCreating this "Please wait..." window? Pin
SimpleData5-Jul-09 7:49
SimpleData5-Jul-09 7:49 
AnswerRe: Creating this "Please wait..." window? Pin
dan!sh 5-Jul-09 7:59
professional dan!sh 5-Jul-09 7:59 
GeneralRe: Creating this "Please wait..." window? Pin
SimpleData5-Jul-09 8:09
SimpleData5-Jul-09 8:09 
GeneralRe: Creating this "Please wait..." window? Pin
danzar5-Jul-09 8:31
danzar5-Jul-09 8:31 
GeneralRe: Creating this "Please wait..." window? Pin
SimpleData5-Jul-09 8:35
SimpleData5-Jul-09 8:35 
GeneralRe: Creating this "Please wait..." window? Pin
dan!sh 5-Jul-09 8:41
professional dan!sh 5-Jul-09 8:41 

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.