LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default How to set the ActivePrinter Property for Microsoft.Office.Interop

I've created the Microsoft.Office.Interop.Excel.ApplicationClass instance
using following code.

theServer = Activator.CreateInstance(ServerType);

private static Type ServerType { get { return
Type.GetTypeFromProgID("Excel.Application"); } }
Type typeof_Server = theServer .GetType();
typeof_Server.InvokeMember("ActivePrinter", BindingFlags.SetProperty, null,
theServer ,new object[] { "MyPrinter on Ne03:" });

I'm not able to set printer property for this instance using the above code.
It gives an exception unable to set the ActivePrinter Property for the
ApplicationClass.

In MSDN the ActivePrinter property for
Microsoft.Office.Interop.Excel.ApplicationClass instance has following
description.
public virtual string ActivePrinter {get; set;}This property supports the
..NET Framework infrastructure and is not intended to be used directly from
your code.

How do i set it.

Thanks
Vinu
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft.Office.Interop.Excel.Application Andie Excel Programming 1 May 22nd 09 04:27 AM
Namespace Microsoft.Office.Interop Mojtaba Excel Programming 1 June 20th 07 01:25 PM
Microsoft.Office.Interop.Excel Texttocolumns C# Cheryl[_5_] Excel Programming 1 April 6th 07 08:40 PM
Where can I find Microsoft.Office.Interop.Excel.dll? Fred Abrahamian Excel Programming 1 December 17th 06 10:52 PM
COMException With Microsoft.Office.Interop.Excel frankvfox Excel Programming 4 September 27th 06 04:36 PM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"