Click here to Skip to main content
15,908,166 members
Home / Discussions / C#
   

C#

 
AnswerRe: Binary Serialization of Dictionary Pin
Henry Minute22-Sep-09 1:44
Henry Minute22-Sep-09 1:44 
QuestionText over Progressbar - Question Pin
Programm3r22-Sep-09 1:25
Programm3r22-Sep-09 1:25 
AnswerRe: Text over Progressbar - Question Pin
Programm3r22-Sep-09 1:36
Programm3r22-Sep-09 1:36 
AnswerRe: Text over Progressbar - Question Pin
firda-cze18-Apr-10 22:21
firda-cze18-Apr-10 22:21 
GeneralRe: Text over Progressbar - Question Pin
Scott Sherin28-May-10 4:15
Scott Sherin28-May-10 4:15 
Questionhow to use a macro in c# Pin
Ajithevn22-Sep-09 0:58
Ajithevn22-Sep-09 0:58 
AnswerRe: how to use a macro in c# Pin
Programm3r22-Sep-09 1:39
Programm3r22-Sep-09 1:39 
GeneralRe: how to use a macro in c# Pin
Ajithevn22-Sep-09 2:29
Ajithevn22-Sep-09 2:29 
the problem is im having a xls file and im opening it using workbook.open() and i select cell A10 and close it next time when i open the file i want the focus back on A1. i.e always the file is open the focus should be on cell A1 for that i used the macro which i stated in the previos thread. but i feel it would be better if i can do that also in the application.
below is the code

private void button1_Click(object sender, EventArgs e)
{
openexcel();
}

private static void openexcel()
{
Excel.Application xlApplication = new Excel.Application();
Excel.Workbooks xlBooks;
Excel.Worksheet xls;

xlBooks = xlApplication.Workbooks;
xlBooks.Open(Application.StartupPath + @"\ExcelFile01.xls", Type.Missing, false, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);

xls = xlApplication.ActiveWorkbook.Worksheets[2] as Excel.Worksheet;
xls.Visible = Excel.XlSheetVisibility.xlSheetHidden;
xls = xlApplication.ActiveWorkbook.ActiveSheet as Excel.Worksheet;
xls.Rows.AutoFit();
//todo
focus back to cell A1


xlApplication.Visible = true;
System.Runtime.InteropServices.Marshal.ReleaseComObject(xls);
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlBooks);
System.Runtime.InteropServices.Marshal.ReleaseComObject(xlApplication);

}
GeneralRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:50
Programm3r22-Sep-09 2:50 
GeneralRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:53
Programm3r22-Sep-09 2:53 
GeneralRe: how to use a macro in c# Pin
thecodedemon23-Sep-09 13:30
thecodedemon23-Sep-09 13:30 
AnswerRe: how to use a macro in c# Pin
Programm3r22-Sep-09 2:57
Programm3r22-Sep-09 2:57 
QuestionPlaying with Enumerations Pin
ezazazel22-Sep-09 0:45
ezazazel22-Sep-09 0:45 
AnswerRe: Playing with Enumerations Pin
harold aptroot22-Sep-09 0:54
harold aptroot22-Sep-09 0:54 
AnswerRe: Playing with Enumerations Pin
Gideon Engelberth22-Sep-09 2:51
Gideon Engelberth22-Sep-09 2:51 
GeneralRe: Playing with Enumerations Pin
ezazazel22-Sep-09 6:49
ezazazel22-Sep-09 6:49 
AnswerRe: Playing with Enumerations Pin
PIEBALDconsult22-Sep-09 4:07
mvePIEBALDconsult22-Sep-09 4:07 
GeneralRe: Playing with Enumerations Pin
ezazazel22-Sep-09 6:47
ezazazel22-Sep-09 6:47 
GeneralRe: Playing with Enumerations Pin
PIEBALDconsult22-Sep-09 13:52
mvePIEBALDconsult22-Sep-09 13:52 
QuestionGetting data from a Listbox controlled by WPF and XML Pin
reg.orton22-Sep-09 0:24
reg.orton22-Sep-09 0:24 
AnswerRe: Getting data from a Listbox controlled by WPF and XML Pin
vivasaayi22-Sep-09 19:37
vivasaayi22-Sep-09 19:37 
GeneralRe: Getting data from a Listbox controlled by WPF and XML Pin
reg.orton23-Sep-09 3:37
reg.orton23-Sep-09 3:37 
QuestionHow to insert javascript funtion dynamically ? Pin
Jacobb Michael21-Sep-09 23:38
Jacobb Michael21-Sep-09 23:38 
AnswerRe: How to insert javascript funtion dynamically ? Pin
Amit Patel198521-Sep-09 23:49
Amit Patel198521-Sep-09 23:49 
GeneralRe: How to insert javascript funtion dynamically ? Pin
Jacobb Michael21-Sep-09 23:52
Jacobb Michael21-Sep-09 23:52 

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.