Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default RegisteredFunctions in C# fails when trying to get the list of addins and function

Hello
I am using a small C# program which uses the office interop and tries
to get the list of addin in a worksheet, but it always returns a
System.DBNull but if I write a small VBA procedure it always succeeds
any ideas or thoughts, I have attach a the code been executed in C#.

using System;
using Microsoft.Office.Core;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Windows.Forms;

namespace ExcelRangeRunMacro
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
RunTest();
Console.ReadLine();
}

private static void RunTest()
{
Excel._Application xlApplication = null;
Excel._Workbook workbook = null;

//Start Excel and get Application object.
xlApplication = (Excel.Application) new Excel.Application();
xlApplication.Visible = true;
workbook =
(Excel._Workbook)(xlApplication.Workbooks.Open(@"H :\Personal\abc_mod.xls", Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing));

xlApplication.Visible = true;
xlApplication.UserControl = true;

object olist2 = xlApplication.get_RegisteredFunctions(Type.Missing ,
Type.Missing);
}
}
}
Reply
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
combination IF- and VLOOKUP-function fails Axel Excel Worksheet Functions 2 December 21st 09 03:46 PM
Excel fails to update call to user-written function. Jim Luedke New Users to Excel 9 August 28th 09 12:46 AM
Hyperlink function fails when using variable row number Balex Excel Worksheet Functions 5 April 8th 06 06:35 AM
Function fails to calculate Dan Smith Excel Worksheet Functions 1 February 20th 06 05:57 AM
In Excel, why sort function fails when applied to a list of date? Excel heavy user Excel Discussion (Misc queries) 1 January 18th 05 06:37 PM


All times are GMT +1. The time now is 07:15 AM.

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

About Us

"It's about Microsoft Excel"