473,395 Members | 1,869 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

CreateInstance - set font properties for excel

Hi,

Hope someone can help me out with this. I have a CC3 sharp app that needs to
export data to an excel file. Problem is the version of excel can be 97 to
2003.

Anyway, have been able to use InvokeMember for ranges and values, ie:

Parameters = new Object[2];

Parameters[0] = "C2:C6";

Parameters[1] = Missing.Value;

objRange_Late = objSheet_Late.GetType().InvokeMember(
"Range",BindingFlags.GetProperty, null, objSheet_Late, Parameters );

Parameters = new Object[1];

Parameters[0] = "=A2 & \" \" & B2";;

objRange_Late.GetType().InvokeMember( "Value",
BindingFlags.SetProperty,null, objRange_Late, Parameters );

What I can't figure how to is set properties like the font, font.color,
bold, etc.

I have looked, searched everywhere I can think of.

I sure would appreciate any help and guidance.

Thanks in advance,

Bud Dean
Nov 17 '05 #1
1 3715
PS
Maybe this works.

object oFont = Rng.GetType().InvokeMember("Font",
BindingFlags.GetProperty, null, Rng, null);
oFont.GetType().InvokeMember("ColorIndex", BindingFlags.SetProperty, null,
oFont, new object[]{5});
oFont.GetType().InvokeMember("Bold", BindingFlags.SetProperty, null,
oFont, new object[]{true});

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: stainless | last post by:
I am currently designing a .NET system that takes a piece of text from a SQL Server database (this is variable), writes it to an excel spreedsheet in a cell of known length and height (in...
3
by: frasmus44 | last post by:
I have searched this group for ways to create jumbo fonts in my Access forms and reports. Unlike MS Word and MS Excel, Access has a 127 point font limit. (About 1.75" tall) I'm referring to bound...
2
by: Baskar RajaSekharan | last post by:
Hi I have one doubt in C#. I created one component called CustomTesting in VC7. The DLL contains Two Method called Execute and SetOCxInterface. I want to Load the Dll from my Sample...
2
by: Amith | last post by:
Hi, I am using an ActiveX created using delphi. It has a font property exposed. The font property is of type IFontDisp in the server(delphi). The font properties like Size, Bold, Underline etc...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
1
by: RBChallenger | last post by:
Can anyone tell me how to set the font properties in an embedded OWC11 excel speradsheet. You can get to the font properties via spreadSheet.Cells.Font.<Property>, however if I want to set the...
24
by: Tony Girgenti | last post by:
Hello. Developing a Windows Form program in VS.NET VB, .NET Framework 1.1.4322 on a windows XP Pro, SP2. Before printing a document, i want to set the font to a font that is only available...
8
by: j2flk1234 | last post by:
Hi, I have a chart that I created in excel through VB. I want to try and change the font name from Times New Roman to Symbol. I tried recording the macro in excel but when I use the code in VB...
0
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Found it. string name = Properties.Settings.Default.ClassName.ToString(); //"myproject.myclass, myassembly" format. //name = "ABC.MyClass, Assem" ; Type t = Type.GetType(name); Object obj...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.