473,326 Members | 2,048 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,326 software developers and data experts.

Access .NET class library from Excel 97

Hi All, does anyone know if it's possible to utilise a .NET class
library from Excel 97 ? I've tried but receive a runtime error
-2146232576 which means nothing to me, my class is shown below, I've
placed the assembly into the GAC and registered it using RegAsm all to
no avail

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;

namespace CallingCSharpFromWord97
{

[ComVisible(true)]
public class PJKWordClass
{
public TextWriter tw = null;

public PJKWordClass()
{
}

public void WriteLogFile(string msg)
{
tw = new StreamWriter("c:\\PJKCalledFromWord97.log", true);
tw.WriteLine(String.Format("This file was created by C# which was
called from a COM client {0} at
{1}",msg,DateTime.Now.ToLongDateString()));
tw.Close();
}

}
}
I can reference the assembly in Excel, but when run, it bombs on the
CreateObject line ( with the error number shown above )

Dim oCSharp As CallingCSharpFromWord97.PJKWordClass

Set oCSharp = CreateObject("CallingCSharpFromWord97.PJKWordClass ")

regards
Jun 27 '08 #1
0 1184

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

Similar topics

0
by: goermezer | last post by:
Hello, I have some problems to automate a CAD (computer aided design) Software called CATIA V5 from Dassault Systemes. CATIA V5 has a builtin VB-Editor like Word, Excel, … and registers itself...
13
by: BigDaDDY | last post by:
Um yeah....In case you haven't figured it out, Microsoft sucks. I'm going to be kicked back in my chair eating popcorn and watching football 10 years from now, while all you clowns are scrambling...
11
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it...
3
by: SAM | last post by:
Hi everyone, I consider myself a very competent programmer when it comes to actual programming and analyzing the business that I'm modelling. I am now crossing into what I would consider Access...
12
by: D. Shane Fowlkes | last post by:
This most likely belongs in another forum but I thought I'd start here. I have a COM Object written in VB6. The DLL will access MS Excel and use it's Object Library to write a customized report...
2
by: Rich | last post by:
Greetings, I am trying to find a way to use a form of GetObject in VB.Net and have been researching WMI. Apparently, this is a vast subject, but seems to reference a Namespace called...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
7
by: ddecoste | last post by:
I have a need to add a visual representation to some data in Access. I need to draw a matix of squares inside another square. I have all the data that I need in a record in Access. The data...
0
NeoPa
by: NeoPa | last post by:
Many of us have noticed that there are some very useful functions available to you when using Excel, but these same functions are not available, as standard, in Access. A particular issue I had...
0
by: Pete Kane | last post by:
Hi All, does anyone know if it's possible to utilise a .NET class library from Excel 97 ? I've tried but receive a runtime error -2146232576 which means nothing to me, my class is shown below, I've...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.