Page 1 of 1

TeeChart ActiveX for Excel Add-in programming using C#

Posted: Fri Sep 25, 2009 9:27 am
by 13051494
My purpose of using TeeChart ActiveX is drawing a trend on a worksheet in order to get and show real-time data from a data source. Users can use TeeChart object like Microsoft Chart. However, I just want to develop Excel Add-in module using TeeChart both in run-time mode and in user design mode.

I have sample C# code to insert TeeChart ActiveX Pro 8 into an Excel worksheet. The obtained object is an OLEObject, which is not easy to manage member methods and data passing.
private void btnAddTrend_Click(object sender, RibbonControlEventArgs e)
{
try
{
Excel.Worksheet xlSheet = Globals.ThisAddIn.Application.ActiveSheet as Excel.Worksheet;

string strTeechart = "TeeChart.TChart.8";
Excel.OLEObject oleTeeChart;

Excel.OLEObjects oleObjects1 = (Excel.OLEObjects)xlSheet.OLEObjects(Type.Missing);

oleTeeChart = oleObjects1.Add(strTeechart, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, 10, 10, 480, 320);

//Assign data to TeeChart object here like:
//oleTeeChart.NoMemberMethodOrVariables();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}

}

I do not know how to call member functions and assign data source of TeeChart in Excel Add-in.

Please tell me that if TeeChart ActiveX can be used for Excel Add-in programming using C# (not VBA) .Net in run-time mode!

Re: TeeChart ActiveX for Excel Add-in programming using C#

Posted: Fri Sep 25, 2009 4:09 pm
by narcis
Hi tomking,

Have you seen the TeeChart with Excel example at C:\Program Files\Steema Software\TeeChart Pro v8 ActiveX Control\Examples\MSOffice\VBA Excel? It would be much easier if you did as in TeeChart Pro Inserted into Excel.xls example.

Hope this helps!

Re: TeeChart ActiveX for Excel Add-in programming using C#

Posted: Sun Sep 27, 2009 3:55 pm
by 13051494
Thanks for your fast response!

Unfortunately, the Excel samples all show this dialog box: Title=Microsoft Visual basic, message=Module not found!
It seems to be understood that the excel files containing TeeChart object and do not have VBA modules.
I checked in VBE and nothing found!

I also checked Security issue for Office VBA but all your Word, Access samples and our VBA codes work well!
Please send me the OK-tested Excel samples for TeeChart ActiveX.

What I want to highlight here is the Excel Add-in development in C# (not VBA) using famous TeeChart ActiveX.
If I test successfully the features of TeeChart ActiveX for our Excel Add-in products,
we will soon decide to buy TeeChart ActiveX beside our current-bought TeeChart .Net.

In fact, we do not want to use VBA for current and future products of Excel Add-in, and C# is our choice.
Hopefully, you, our TeeChart .Net supporters, would like to show us the power of TeeChart ActiveX for Excel Add-in development!

Looking forward to seeing your answer soon!

Re: TeeChart ActiveX for Excel Add-in programming using C#

Posted: Mon Sep 28, 2009 12:51 pm
by narcis
Hi tomking,

The problem could be that TeeChart8.ocx is not registered in your machine. Have you downloaded and installed the fully functional evaluation version? I also attach mentioned examples which work fine for me here.

Re: TeeChart ActiveX for Excel Add-in programming using C#

Posted: Tue Sep 29, 2009 2:55 am
by 13051494
Hello NarcĂ­s Calvet,

I did check the MS Word samples, and all ran well. That means TeeChart ActiveX was registered successfully!

I checked Macro/VBA security levels of Excel (2003 or 2007) to the lowest and ran samples on 3 machines (Vista, Win 7, XP), in which TeeChart AX eval was installed.

All tests notified that "VBA module not found!".
So please print out all VBA modules inside Excel samples to MS Word or plain text, then I can read and study from VBA for my C# purpose.

One more question: Does TeeChart ActiveX inside Excel run in real-time mode?
/* In detail, Could you write for me an example of Excel and TeeChart ActiveX implementing these? (VBA or C# is both Good)
- Insert a TeeChart AX object into Excel sheet
- Add a Timer to current excel sheet
- let Timer run while Assigning Data source for TeeChart AX object
*/

In the coming October, I want to conclude that whether to use TeeChart AX for our Excel Add-in or use other solution, then implement our Trend tool Add-in soon.

Please tell me as soon as possible!
Thank you very much.

P.S: Our Windows Form applications work very smoothly with your TeeChart .Net (C# project). Impressive!
Thus, we are considering to pack our total solution with TeeChart: .Net, Compact .Net and ActiveX (web and MS Office solutions).
Unfortunately, TeeChart AX for Excel Add-in by C# seems to not have rich samples or information(?) (Sorry, I maybe wrong to state this^^).
C# and VBA are somewhat different for MS Office Add-in architecture. Plus some other reasons, we appreciate TeeChart ActiveX for Excel Add-in solution using C#.
Thanks again^^

Re: TeeChart ActiveX for Excel Add-in programming using C#

Posted: Tue Sep 29, 2009 8:48 am
by narcis
Hi tomking,
All tests notified that "VBA module not found!".
So please print out all VBA modules inside Excel samples to MS Word or plain text, then I can read and study from VBA for my C# purpose.
Find attached a zip package with each example code in a text file.
One more question: Does TeeChart ActiveX inside Excel run in real-time mode?
/* In detail, Could you write for me an example of Excel and TeeChart ActiveX implementing these? (VBA or C# is both Good)
- Insert a TeeChart AX object into Excel sheet
- Add a Timer to current excel sheet
- let Timer run while Assigning Data source for TeeChart AX object
*/
Yes, something similar is what's shown in the examples. If you don't succeed creating your own examples don't hesitate to let us know.