.NET Forum / .NET Framework / Interop / January 2005
Add-In Class For Excel
|
|
Thread rating:  |
Luis Simões - 19 Jan 2005 10:53 GMT Hi,
I have created a dll with some functions to use in excel, but after i compile the code and try to use it in excel it gives me an error like it could not find the file "mscoree.dll" who can i overdue this error? And why does it show mscoree.dll and not my dll file name?
Best Regards, Luis Simões
YuriL - 19 Jan 2005 21:16 GMT Hi Luis, If I remember correctly, mscoree.dll is the .NET framework. Are you trying to use this dll on a different machine than where you developed it? If so, you should check to make sure that you have the latest version of the .NET framework installed on the machine where you expect your dll to work. Hope that helps! Yuri
> Hi, > [quoted text clipped - 5 lines] > Best Regards, > Luis Simões Luis Simões - 19 Jan 2005 23:01 GMT Hi YuriL thanks for the reply, that was really a possibility if i was trying in a production evironment but the error occurs in the machine where i'm developing the addin. I have the .NET Framework 1.1 installed. If i ignore the message the addin works fine. ;/
Another thing Automation Addins don't keep global variables right? I needed to have a connection to a database open and the functions in the dll should use it... how can i manage that?
Regards, Luis Simões
> Hi Luis, > If I remember correctly, mscoree.dll is the .NET framework. Are you trying [quoted text clipped - 13 lines] > > Best Regards, > > Luis Simões YuriL - 20 Jan 2005 14:55 GMT Sorry Luis, I am not really familiar with what an Automation AddIn is. As far as keeping a single connection open throughout the existance of an object - I think it is not recommended, since you are using the resource for as long as the object in which the connection was opened exists, regardless of whether a method of that object is using the connection. However, the way I would keep a connection open the whole time, is to create it and open it in the constructor. However, you are depending on the Garbage Collector to close it if you take this approach - the problem is that you will not know exactly when the connection will get closed, and when the resources get freed up. I am not sure if this is the answer you're looking for. Good luck!
Yuri
> Hi YuriL thanks for the reply, that was really a possibility if i was trying > in a production evironment but the error occurs in the machine where i'm [quoted text clipped - 27 lines] > > > Best Regards, > > > Luis Simões Luis Simões - 20 Jan 2005 15:49 GMT Not really the point Yuri.
Lets put it this way in a pratical example:
The target here is to make a component to put values obtain from analysis services cube in a certain cell.
Lets suppose i go to a cell and insert the following formula: "=get_value(dimension1, dimension2, et...) the automation addin should respond to the get_value function and put the value there.
The Shared Addin was only to make a certain user interface to make it more easy to insert the formula ( The idea was to double click the cell and a panel opens with all the dimensions where the user should pick the ones we wanted and when he pressed ok the addin generated the formula syntax and inserted it in the cell)
As you can see that action of the shared addin would get the automation addin to respond to the generated formula and get the value.
But till now everything is ok... The problem is... Ok Where is the Connection? What Connection should i use?
The shared addin have already an interface to specify and configure Connection Strings. But even if i get the conn string and open the connection, the automation addin don't know that connection and it needed to, so the formula would get to the cube.
Got the point? ehehe its not really simple but i really need to make that work.
As for keeping the connection open what do you advice? Every formula opens and closes the connection? What if i have 10000 formulas in the sheet? It goes madly slow no?
Best Regards, Luis Simões
> Sorry Luis, > I am not really familiar with what an Automation AddIn is. As far as [quoted text clipped - 41 lines] > > > > Best Regards, > > > > Luis Simões YuriL - 20 Jan 2005 16:33 GMT Wow! I'm not sure I understood all of that, but from what I understand, you have two objects: Shared Addin and Automation Addin. The way I understand, is that you created both of these objects yourself. Are you having a problem passing the connection between the two objects? If so, maybe you can create a Set property in the Automation Addin - this property would get passed the connection string from the Shared Addin, and you could create a connection from it - again sorry if this is wrong but I don't really have a clear picture of what you are trying to do. As far as what connection to use, this depends on the type of datasource that you are connecting to (OLE DB would use an OleDBConnection, SQL Server would use a SqlConnection, etc...). I have never worked w/ data cubes, so I don't know which of these connections you should use. About the constantly open connection - I also, sometimes keep the connection open for the life of an object - I was just saying this is bad practice :-P For your specific case, maybe you could store the formulas localy, and then have one massive update when it is necessary. All the Best, Yuri
> Not really the point Yuri. > [quoted text clipped - 79 lines] > > > > > Best Regards, > > > > > Luis Simões Luis Simões - 20 Jan 2005 16:43 GMT Thats almost the point i have already thought about having the Set property at the Automation Add-in asking for the active connection string or object from the Shared Add-in but i didn't knew if that was a good option.
So the now i will try that... but i must always check if there is a connection made or setup and if the shared addin is loaded even if the option is to load at start.
Another question: How can i trought the Shared Addin load the Automation Addin without having to go to the excel addins panel?
Other problem is that the Automation Addin somes only starts working after the second call...
If i insert a formula the first time in the excel worksheet it wont go right, after that it just works fine...
Best Regards, Luis Simões
> Wow! I'm not sure I understood all of that, but from what I understand, you > have two objects: Shared Addin and Automation Addin. The way I understand, [quoted text clipped - 98 lines] > > > > > > Best Regards, > > > > > > Luis Simões YuriL - 20 Jan 2005 17:35 GMT Sorry Luis - again, I'm not very good with the Excel library so - I don't know how to load addins in Excel programattically. You may have to record a macro to do that for you. Best, Yuri
> Thats almost the point i have already thought about having the Set property > at the Automation Add-in asking for the active connection string or object [quoted text clipped - 118 lines] > > > > > > > Best Regards, > > > > > > > Luis Simões Luis Simões - 20 Jan 2005 17:39 GMT Ok no problem.
If i can manage to do the rest i am a happy person ;)
Thats just a minor detail in a big world of code ehee
Thanks for the support.
Anyway my request to find a way to use the shared addin completly without having to code 2 dlls ( 1 Shared Addin and other Automation ) is still up... If i cannot get formulas to run on a shared addin is really a strange behavior from microsoft...
Best Regards, Luis Simões
> Sorry Luis - again, I'm not very good with the Excel library so - I don't > know how to load addins in Excel programattically. You may have to record a [quoted text clipped - 124 lines] > > > > > > > > Best Regards, > > > > > > > > Luis Simões Luis Simões - 21 Jan 2005 09:47 GMT By the way, If my shared add-in is loaded at startup, how can my automation add-in get the connection string from it? Or by other others how can i get my shared addin object so i get access its propertys?
Regards, Luis Simões
> Ok no problem. > [quoted text clipped - 140 lines] > > > > > > > > > Best Regards, > > > > > > > > > Luis Simões
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|