Click here to Skip to main content
15,880,392 members
Home / Discussions / C#
   

C#

 
GeneralRe: Webservice and proxy Pin
Mogyi14-Oct-09 2:15
Mogyi14-Oct-09 2:15 
AnswerRe: Webservice and proxy Pin
Hristo-Bojilov14-Oct-09 2:04
Hristo-Bojilov14-Oct-09 2:04 
GeneralRe: Webservice and proxy Pin
Mogyi14-Oct-09 2:17
Mogyi14-Oct-09 2:17 
QuestionOpening a named browser window from a windows application Pin
mSh198513-Oct-09 22:26
mSh198513-Oct-09 22:26 
QuestionAdding Data to datagridview [modified] Pin
ldsdbomber13-Oct-09 20:36
ldsdbomber13-Oct-09 20:36 
AnswerRe: Adding Data to datagridview Pin
OriginalGriff13-Oct-09 23:50
mveOriginalGriff13-Oct-09 23:50 
GeneralRe: Adding Data to datagridview Pin
ldsdbomber14-Oct-09 1:22
ldsdbomber14-Oct-09 1:22 
Questionwrite to a excel sheet that is already open Pin
ananya choudhury13-Oct-09 17:18
ananya choudhury13-Oct-09 17:18 
Hi,

I want to write some data to an excel sheet. If it is open, then write to the same excel sheet, if not open, then open the excel sheet and perform operations.

I dont know how to get control of the open excel sheet.

Here is my code:
//check if the worksheet is already open.
try
{
using (FileStream fs = File.Open(txtBx_worksheetPath.Text, FileMode.Open))
{
if(fs == null)
{
theWorkbook = ExcelObj.Workbooks.Open(txtBx_worksheetPath.Text, 0, false, 5,
System.Reflection.Missing.Value, System.Reflection.Missing.Value, false, Excel.XlPlatform.xlWindows,"\t", true, false, 0, true, false, System.Reflection.Missing.Value);
}
}
}
catch(Exception)
{
// activate excel sheet
// theWorkbook.Activate();
}

Now, if the file is already open, then it performs nothing.
I dont want to close the excel sheet and reopen it.

Please help me.

Thanks
Ananya
QuestionApp Communication via screen reads Pin
Rizean13-Oct-09 15:54
Rizean13-Oct-09 15:54 
QuestionVisual Studio integrated Source Control Pin
Expert Coming13-Oct-09 13:46
Expert Coming13-Oct-09 13:46 
AnswerRe: Visual Studio integrated Source Control Pin
Expert Coming13-Oct-09 15:26
Expert Coming13-Oct-09 15:26 
GeneralRe: Visual Studio integrated Source Control Pin
Not Active13-Oct-09 17:41
mentorNot Active13-Oct-09 17:41 
AnswerRe: Visual Studio integrated Source Control Pin
Kevin Marois14-Oct-09 5:38
professionalKevin Marois14-Oct-09 5:38 
Question[Message Deleted] Pin
arkiboys13-Oct-09 12:20
arkiboys13-Oct-09 12:20 
AnswerRe: linqtoxml - update Pin
Christian Graus13-Oct-09 12:23
protectorChristian Graus13-Oct-09 12:23 
GeneralRe: linqtoxml - update Pin
arkiboys13-Oct-09 12:34
arkiboys13-Oct-09 12:34 
AnswerRe: linqtoxml - update Pin
Not Active13-Oct-09 12:27
mentorNot Active13-Oct-09 12:27 
QuestionWindows Service and Process Class [modified] Pin
Fallout_Monkey13-Oct-09 11:37
Fallout_Monkey13-Oct-09 11:37 
AnswerRe: Windows Service and Process Class Pin
Jacobb Michael13-Oct-09 17:35
Jacobb Michael13-Oct-09 17:35 
GeneralRe: Windows Service and Process Class Pin
Fallout_Monkey27-Oct-09 6:39
Fallout_Monkey27-Oct-09 6:39 
AnswerRe: Windows Service and Process Class Pin
Dave Kreskowiak13-Oct-09 18:27
mveDave Kreskowiak13-Oct-09 18:27 
GeneralRe: Windows Service and Process Class Pin
Fallout_Monkey27-Oct-09 6:42
Fallout_Monkey27-Oct-09 6:42 
GeneralRe: Windows Service and Process Class Pin
Dave Kreskowiak27-Oct-09 11:59
mveDave Kreskowiak27-Oct-09 11:59 
GeneralRe: Windows Service and Process Class [modified] Pin
Fallout_Monkey28-Oct-09 4:56
Fallout_Monkey28-Oct-09 4:56 
GeneralRe: Windows Service and Process Class Pin
Dave Kreskowiak28-Oct-09 13:26
mveDave Kreskowiak28-Oct-09 13: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.