Click here to Skip to main content
15,891,993 members
Home / Discussions / C#
   

C#

 
AnswerRe: reading a checkbox from another thread Pin
12Code2-Apr-09 4:04
12Code2-Apr-09 4:04 
GeneralRe: reading a checkbox from another thread Pin
Bruce Coward2-Apr-09 4:18
Bruce Coward2-Apr-09 4:18 
AnswerRe: reading a checkbox from another thread Pin
DaveyM692-Apr-09 4:19
professionalDaveyM692-Apr-09 4:19 
QuestionHow to Save Web Page, complete in C# Pin
dataminers2-Apr-09 3:08
dataminers2-Apr-09 3:08 
AnswerRe: How to Save Web Page, complete in C# Pin
fabrice.leal2-Apr-09 4:08
fabrice.leal2-Apr-09 4:08 
GeneralRe: How to Save Web Page, complete in C# Pin
dataminers2-Apr-09 5:41
dataminers2-Apr-09 5:41 
QuestionExcel with Early and LateBinding Pin
MumbleB2-Apr-09 2:20
MumbleB2-Apr-09 2:20 
AnswerRe: Excel with Early and LateBinding Pin
Pete O'Hanlon2-Apr-09 2:39
mvePete O'Hanlon2-Apr-09 2:39 
You can do this using something like this:
// Instantiate Excel using the prog id.
object xl = Activator.CreateInstance(Type.GetTypeFromProgID("Excel.Application"));
// Get the workbooks collection
object books = xl.GetType().InvokeMember( 
       "Workbooks", BindingFlags.GetProperty, null, xl, null);
// Add a workbook
object book = books.GetType().InvokeMember( "Add",
       BindingFlags.InvokeMethod, null, books, null );
// Get a reference to the worksheets
object sheets = book.GetType().InvokeMember( "Worksheets",
      BindingFlags.GetProperty,null, book, null );
// and select the first sheet.
object[] parameters;
parameters = new object[1];
parameters[0] = 1;
object sheet = sheets.GetType().InvokeMember( "Item",
       BindingFlags.GetProperty, null, sheets, parameters );
// get the "range" A1.
parameters = new object[2];
parameters[0] = "A1";
parameters[1] = Missing.Value;
object range = sheet.GetType().InvokeMember( "Range",
      BindingFlags.GetProperty, null, sheet, parameters );
// And set the value of it to 1.
parameters = new object[1];
parameters[0] = "1";
range.GetType().InvokeMember( "Value", 
      BindingFlags.SetProperty, null, range, parameters );

// Now, set Excel to visible.
parameters = new object[1];
parameters[0] = true;
xl.GetType().InvokeMember( "Visible", 
      BindingFlags.SetProperty, null, xl, parameters );
I've just knocked this together in Notepad, so I apologise if it's not 100% perfect.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: Excel with Early and LateBinding Pin
MumbleB2-Apr-09 2:50
MumbleB2-Apr-09 2:50 
GeneralRe: Excel with Early and LateBinding Pin
Pete O'Hanlon2-Apr-09 3:08
mvePete O'Hanlon2-Apr-09 3:08 
GeneralRe: Excel with Early and LateBinding Pin
MumbleB2-Apr-09 3:21
MumbleB2-Apr-09 3:21 
QuestionTake backup of Outlook message Rules, programatically Pin
ashok_rgm2-Apr-09 1:42
ashok_rgm2-Apr-09 1:42 
QuestionOffice 2007 Pin
Sajjad Leo2-Apr-09 1:07
Sajjad Leo2-Apr-09 1:07 
QuestionRe: Office 2007 Pin
Cracked-Down2-Apr-09 1:41
Cracked-Down2-Apr-09 1:41 
AnswerRe: Office 2007 Pin
Sajjad Leo2-Apr-09 1:52
Sajjad Leo2-Apr-09 1:52 
GeneralRe: Office 2007 Pin
King Julien2-Apr-09 2:17
King Julien2-Apr-09 2:17 
QuestionHow to pass parameters to JavaScript Functions from C#? Pin
codddy2-Apr-09 0:54
codddy2-Apr-09 0:54 
AnswerRe: How to pass parameters to JavaScript Functions from C#? Pin
Pete O'Hanlon2-Apr-09 1:41
mvePete O'Hanlon2-Apr-09 1:41 
GeneralRe: How to pass parameters to JavaScript Functions from C#? Pin
codddy2-Apr-09 3:04
codddy2-Apr-09 3:04 
Questionto increse size of a panel, its override another controls Pin
myms.net2-Apr-09 0:43
myms.net2-Apr-09 0:43 
RantRe: to increse size of a panel, its override another controls Pin
Greg Chelstowski2-Apr-09 0:52
Greg Chelstowski2-Apr-09 0:52 
AnswerRe: to increse size of a panel, its override another controls Pin
Henry Minute2-Apr-09 1:29
Henry Minute2-Apr-09 1:29 
GeneralRe: to increse size of a panel, its override another controls Pin
myms.net2-Apr-09 1:38
myms.net2-Apr-09 1:38 
GeneralRe: to increse size of a panel, its override another controls Pin
Henry Minute2-Apr-09 1:42
Henry Minute2-Apr-09 1:42 
QuestionHow to split & merge mpeg video files Pin
pravat_SABAT2-Apr-09 0:37
pravat_SABAT2-Apr-09 0:37 

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.