Click here to Skip to main content
15,884,099 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mixed mode assembly is built against version 'v2.0.50727' Pin
Le@rner5-Jun-22 22:34
Le@rner5-Jun-22 22:34 
Questionasync-await block Pin
j11codep31-May-22 16:46
j11codep31-May-22 16:46 
AnswerRe: async-await block Pin
Richard Deeming31-May-22 21:44
mveRichard Deeming31-May-22 21:44 
QuestionAdding items to a list updates all previous items Pin
Code4Ever27-May-22 5:58
Code4Ever27-May-22 5:58 
AnswerRe: Adding items to a list updates all previous items Pin
Gerry Schmitz27-May-22 6:21
mveGerry Schmitz27-May-22 6:21 
GeneralRe: Adding items to a list updates all previous items Pin
Code4Ever27-May-22 6:31
Code4Ever27-May-22 6:31 
AnswerRe: Adding items to a list updates all previous items Pin
James Curran21-Jun-22 7:55
James Curran21-Jun-22 7:55 
QuestionHow do I add text via c# to an OPEN Excel Workbook? Pin
jrdnoland18-May-22 11:21
jrdnoland18-May-22 11:21 
I need to be able to send text to a selected worksheet that is already opened.

This, I think is close but it didn't work:

<pre lang="C#">

string wb = cmb_BookName.Text.ToString();
string ws = cmb_SheetName.Text.ToString();

if (chkContainer.Checked)
{
Excel.Application oexcel = new Excel.Application();
Excel.Workbook wkbk = (Excel.Workbook)oexcel.Workbooks[wb];
Excel.Worksheet wksk = (Excel.Worksheet)wkbk.Sheets[ws];
Range cellRange = wksk.Range["D48:D48"];
cellRange.Value = cboContainer.Text;
}

</pre>

The code builds without errors but when running it stops at the line trying to get the workbook and gives me an Exception Unhandled message.

So basically my question still is how do I work with an excel workbook that is already opened?

Seems like most of the articles that I find are opening an excel file and then working with it. In my case, I need to work with an already opened excel workbook.
AnswerRe: How do I add text via c# to an OPEN Excel Workbook? Pin
OriginalGriff18-May-22 19:18
mveOriginalGriff18-May-22 19:18 
AnswerRe: How do I add text via c# to an OPEN Excel Workbook? Pin
Richard Deeming18-May-22 23:46
mveRichard Deeming18-May-22 23:46 
GeneralRe: How do I add text via c# to an OPEN Excel Workbook? Pin
Eddy Vluggen20-May-22 8:13
professionalEddy Vluggen20-May-22 8:13 
AnswerRe: How do I add text via c# to an OPEN Excel Workbook? Pin
RedDk20-May-22 9:54
RedDk20-May-22 9:54 
JokeRe: How do I add text via c# to an OPEN Excel Workbook? Pin
Richard Andrew x6421-May-22 4:05
professionalRichard Andrew x6421-May-22 4:05 
GeneralRe: How do I add text via c# to an OPEN Excel Workbook? Pin
Richard MacCutchan21-May-22 6:07
mveRichard MacCutchan21-May-22 6:07 
GeneralRe: How do I add text via c# to an OPEN Excel Workbook? Pin
RedDk21-May-22 7:50
RedDk21-May-22 7:50 
QuestionSend message to Microsoft teams group via connector Pin
sdesilets18-May-22 8:40
sdesilets18-May-22 8:40 
AnswerRe: Send message to Microsoft teams group via connector Pin
lmoelleb19-May-22 0:48
lmoelleb19-May-22 0:48 
GeneralRe: Send message to Microsoft teams group via connector Pin
sdesilets19-May-22 4:44
sdesilets19-May-22 4:44 
QuestionAnyone have experience porting Wonderware scripting to C#.net? Pin
Bruce Armstrong 202218-May-22 6:36
Bruce Armstrong 202218-May-22 6:36 
AnswerRe: Anyone have experience porting Wonderware scripting to C#.net? Pin
Eddy Vluggen20-May-22 4:11
professionalEddy Vluggen20-May-22 4:11 
QuestionIs there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Code4Ever18-May-22 6:25
Code4Ever18-May-22 6:25 
AnswerRe: Is there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Gerry Schmitz18-May-22 7:34
mveGerry Schmitz18-May-22 7:34 
AnswerRe: Is there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Victor Nijegorodov18-May-22 9:27
Victor Nijegorodov18-May-22 9:27 
QuestionHZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Eddie You17-May-22 14:15
Eddie You17-May-22 14:15 
AnswerRe: HZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Richard MacCutchan17-May-22 21:26
mveRichard MacCutchan17-May-22 21:26 

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.