How to share com component between C# and VBA

Hi All,

Have a C# app which makes a call to VBA macro using in-memory excel. 

I am unable to share the data between C# and VBA macro by using the same COM component.

Both C# and VBA invoked this COM component through interop layer.

Please advise.



Submitted via EggHeadCafe - Software Developer Portal of Choice 
Using SQL Server Notification Services Platform
http://www.eggheadcafe.com/tutorials/aspnet/ecbc1965-42af-4376-b400-4aae5e12f872/using-sql-server-notifica.aspx
0
Sridhar
1/11/2010 2:33:46 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

3 Replies
645 Views

Similar Articles

[PageSpeed] 8

"Sridhar Yada" wrote in message news:201011193338sridhar.yada@nomura.com...

> Please advise.

You'll need to provide the code which isn't working if you expect anyone to 
help you with it...


-- 
Mark Rae
ASP.NET MVP
http://www.markrae.net 

0
Mark
1/11/2010 3:24:52 PM
Sridhar Yada wrote in news:201011193338sridhar.yada@nomura.com:

> Have a C# app which makes a call to VBA macro using in-memory excel. 
> 
> I am unable to share the data between C# and VBA macro by using the
> same COM component. 
> 
> Both C# and VBA invoked this COM component through interop layer.

Using the same COM component? What do you mean?

If you mean, both can call the same component, then it is normal you cannot 
share, unless the component persists the state, as each one is opening the 
COM component in their own process space. 

To put this in an analogy, it would be like stating, I just called 
Microsoft and a guy in France has called Microsoft, why am I not privy to 
his phone call?

Peace and Grace,

-- 
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
|      Think outside the box!             |
*******************************************
0
Gregory
1/11/2010 4:33:43 PM
You might mean that an COM object or type created by one of the callers (C#, 
VBA) can't be used by the other one. This related to having (or not) a 
Primary Interop Assembly as your interop layer for all clients.
-- 
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Sridhar Yada" wrote in message news:201011193338sridhar.yada@nomura.com...
> Hi All,
>
> Have a C# app which makes a call to VBA macro using in-memory excel.
>
> I am unable to share the data between C# and VBA macro by using the same 
> COM component.
>
> Both C# and VBA invoked this COM component through interop layer.
>
> Please advise.
>
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> Using SQL Server Notification Services Platform
> http://www.eggheadcafe.com/tutorials/aspnet/ecbc1965-42af-4376-b400-4aae5e12f872/using-sql-server-notifica.aspx 

0
Wilson
1/12/2010 12:21:03 AM
Reply:

Similar Artilces:

Shared folders on a shared exchange 2003
I have a shared exchange 2003 where deferent company�s have there mails. But how do I make a shared public folder for each company? The public folders may not be visible for other then the people in the actual company. /C COZ <kofo@spamspamspam.org> wrote: >I have a shared exchange 2003 where deferent company�s have there mails. >But how do I make a shared public folder for each company? >The public folders may not be visible for other then the people in the >actual company. Make sure the "client permissions" you assign to the folder doesn't include the &...

C source code to flowchart
hi all I'm seeking for a software or Visio add-ins that read C and/or C++ source codes and automatically draw Visio flowchart of it. can anybody help me? regards herfaee visio doesn't (as far as I know) have the ability to reverse engineer flowcharts. this is a fairly common request for both c++ and vb. >-----Original Message----- >hi all > >I'm seeking for a software or Visio add-ins that read C and/or C++ source >codes and automatically draw Visio flowchart of it. >can anybody help me? > > >regards >herfaee > > >. > Just out of...

Sharing Calendar, can you share contacts too?
We have an administrative secretary, who maintains 3 high level administrator's calendars... we use outlook 2003 with exchange 2003, she opens their shared calendars and edits them... Maybe I'm overlooking a really simple answer... but is there a way she could similarly edit their personal address books (they all use palm pilots and want their own individual contact lists).... Any ideas appreciated... Thanks! Sure, just need to delegate rights to those folders and she can "Open Other user's Folder" and choose Contacts. "Ken Montgomery" <KenMontg...

Shared Workbook Query
Hi, I have set up a shared workbook for 20+ users. I am aware that share workbooks in Excel (I have version 2002) have limited functionality an that you cannot for example merge cells. However, if there are merged cells in another worksheet and someon wants to copy across text (which includes merged cells) into the share workbook it removes the merged formatting. At present I have to take the share off the workbook and then cop across the data (which includes merged cells) then reshare the workboo so that the formatting is maintained. Is there any other way around this problem so that peo...

Sharing Outlook between profiles?
I am running a 2k server (no exchange server) and need the laptops that connect into the domain to be able to view and send emails when connected, and when disconnected. The laptops have just been reloaded after using Novell. The advantage of the novell client was that it used the same local profile for connecting into the domain, and when using the workstation only. With the 2k server however, it uses one profile for the domain, and one for the local workstation. This is where Outlook 2000 is falling over... Please help... ...

1000 Message A Minute From postmaster@mydomain.com
Please help! Exchange 2003 Server is sending 1000 messages a minute out the Default SMTP Virtual Server. I stop the SMTP Connector and that temporarily stops the chaos but also the functionality of the Server. What is causing this problem and how do I stop it from happening? I've gone through Knowledge Base Article 324958 and nothing works there, the messages just build up in queue instead of going out to the Internet. Exchange Anti-Virus is catching them but will not find a virus that is causing the problem. Any suggestions? Thanks, CS You might want to check to ensure tha...

The VBA project could not be signed
I have a user who was once able to digitally sign his excell documents. Now he receives the following error: There was a problem with the digital certificate. The VBA project could not be signed. The signature will be discarded. Can anybody please help? How do I fix this? ...

VBA select paragraphs to set style
I'm trying to automate formatting of a Table of Contents document. How can I use VBA to find all paragraphs that do NOT include a tab followed by a number (page number) and change the style setting for those paragraphs? (These are the chapters.) I know how to change the style, but I'm not sure how to evaluate what the paragraph "contains". I'm using Word 2002 SP3. Hi, The following macro applies the Heading 2 style to all paragraphs in a document that do not contain a tab followed by a number. Sub ApplyStyleSelectively() Dim prg As Paragraph ...

MFC and number of times COM intialized
Greetings, I was told that COM should be intialized only once in application or once per thread. I was reading SDK samples and it says: "CoInitialize could be called more than once in an application. The first successful call will return NOERROR; subsequent successful calls will return S_FALSE. Each successful nested call to CoInitialize must be matched with a corresponding call to CoUninitialize. CoUninitialize frees resources the COM libraries have allocated and unloads the libraries themselves. " I have a working MFC based application which intializes COM only once and it wor...

Cannot share calendar
Hi I'm trying to setup a user so that she can view someone else's calendar. I have been able to give her access to other peoples calendars, however i can't give her access to one particular user. even though other people can access that particular users calendar. I have given her all the relevent permissions needed to do so in exchange 2000 and at the target machine, but still an error msg of "you do not have sufficiant permisions to view this item" is given. Don't know what else to do....HELP Thank you Don't grant permissions in the Exchange server its...

becky comming
Becky is comming on sat at 1:00pm-- We will have supper here at 4pm . I would like as many as can to come and at least stop in. Slao baout Xmas I think we need to keep it at 7PM on Xmas after Jimmy gets off. Than no one will have to ask off work and those that can come early and we will have finger food so you can eat when you want. The presents will start around 7:30-- That way you will have all day for other plans even a nap if needed. Please let me know how this sounds Love Mom ...

Handling HTML events using MFC/C++ #2
Hello guys! I have following situation: I created application and embedded Microsoft Web Browser ActiveX, so I can modify HTML content, iterate through element collections (suppose I have button with id="myButton" - I already can change its caption, change elements, pictures, etc.). The problem is that I can not capture events from within the ActiveX control (here: Web Browser). There is a HTMLElementEvent2 interface, but I don't know how to create my own implementation of Event Sink. Please look at code below and help me with this, or point to proper paper or sample code. Help...

calender sharing
I recently upgraded to XP op sys and alongwith it to MS Office 2003. In MS Office 2000, I used to share my private Outlook folders (Calendar, Contacts etc.) with my assistant . With this upgrade to MS Office, I lost the sharing ability. If I right click on any of these components (Calendar, Contacts etc.) the "Sharing" feature is shaded (disabled). How do I share these private folders? If you are talking about NetFolders then this feature was dropped after Outlook 2000 check out http://www.slipstick.com/outlook/share.htm for some options "KAH" <anonymous@discussions.mic...

Resource sharing error
MS Project 2007 question / assistance needed - I created a separate project file for shared resources, filled in names of resources (techs), hourly rates, etc., etc, then saved the file as (named) "resources". When I try to share those resources in my current project, (tools>resource sharing>Share resources) and select the "resources from" the resources file, each resource then shows up in BOTH project’s resource files. Now all resources are showing up in both projects? Delete unwanted rows from one project, and they're deleted in BOTH projects. What...

MSChart C++ Sample code
Anyone have any decent sample code that I can look at. Thanks. Carl. There are some samples of this control here: http://www.codeproject.com/miscctrl ----- Ajay Kalra ajaykalra@yahoo.com ...

Connecting to a shared SSRS data source from BIDS
I'm just starting out using BIDS and creating reports in general. I've been using Report Builder and have no trouble accessing a shared SSRS data source by specifying the Report Server (http://<Server>/ReportServer) in the Options...Settings, from there I can view and use any predefined data source in a report. How do I specify in BIDS that I wish to use a preconfigured shared data source from SSRS, I can't see any obvious option. Any advice gratefully received. Thanks David David, Hopefully when you connect your report to a shared datasource in design t...

Converting C# object to XmlElement object.
Hi everyone, the class XmlSerializer provides a generic way to convert a C# object to a XML file. Does anybody know a similar way to convert a C# object to a XmlDocument or XmlElement object without writing the content to an external file? I am using a XML DOM tree as a sort of in-memory "database": various components of our application saves their states into certain sub-trees of the DOM tree. thanks, James X. Li James X. Li wrote: > the class XmlSerializer provides a generic way to convert a > C# object to a XML file. Does anybody know a similar way > to convert...

Sharing the Entourage calendar
Do you know how to share the calendar so my team can view it and my assistant can post items to it? I know there's a save for web function, and if that's the best way to do it, is there a way to automate it so that it saves and uploads to my website? On 7/6/04 11:03 pm, in article fc11fd4e.0406071403.192a07bf@posting.google.com, "Michel" <michel@neray.com> wrote: > Do you know how to share the calendar so my team can view it and my > assistant can post items to it? I know there's a save for web > function, and if that's the best way to do it, is there...

how to count#cells w/= value in other column and not count blank c
In column A, I have values equal to either YES, NO or NA. In column B, I have values equal to either YES, NO or NA. I want to count the # of cells in column B that equal to their counterpart in column A, but I do not want to count blank cells, ex: A B 1 Yes Yes 2 No No 3 NA No 4 5 Yes Yes 6 Yes Yes 7 8 No No 9 No No Result for B10 should be 6 as I do not want to count row 4 and row 7 thanks in advance! =SUMPRODUCT(--(A1:A9=B1:B9);--(NOT(ISBLANK(A1:A9)))) -- Regards! Stefi „aganoe” ezt írta: > In column A, I have values equal to either YES,...

update email account as guest on another computer( peoplepc.com )
i cannot open email for fearlessnlilmis@peoplepc.com (outlook express) as a guest on another computer.trying to change pass word In news:3EDEBA1D-EAB8-4DDB-ABCF-C5F371531D81@microsoft.com, lilmisdangrus <lilmisdangrus@discussions.microsoft.com> typed: > i cannot open email for fearlessnlilmis@******** (outlook > express) as a guest on another computer.trying to change pass word Hi - well, Guest can't do much at all, and most people recommend leaving it disabled. Use webmail if this isn't your computer. Why would you want your mail sitting on someone else's comput...

Scatter Chart Axis as text C#
Hi, I'm creating a scatter chart in C#, and I need its X axis values to be dates or strings that represent dates... the data source where I get the data from is a DataTable with 2 columns... X,Y, which X are dates and Y floats, can Anyone help me display the dates in the X axis...? Pablo -- Message posted via http://www.officekb.com A XY Scatter chart can have dates on the x-axis without any additional work. Just make sure you have the dates set up as XL understands them (which I believe is how all MS Office apps understand them). The whole number part is the number of days since ...

shared workbook
I have a shared workbook. Once in a while, I cannot uncheck the allow changes by more than one user at the same time. This option in the shared workbook under the tools menu is grayed out. Other times this option is available. Can someone please tell me why this option becomes unavailable. ...

RemoteApp is the solution to share .pst files
RemoteApp in Server 2008 is the solution to share .pst files over in local network or the internet! At last, no need for Exchange. ss. Alas, still not supported for .psts on a network share. Use at your own = risk. --=20 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. =20 "Synapse Syndrome" <synapse@NOSPAMsyndrome.me.uk> wrote in message = news:%23sexHtIuIHA.4772@TK2MSFTNGP03.phx.gbl... RemoteApp in Server 2008 is the solution to share .pst fi...

How to map a user local string (using OS code page) to UTF-8 and vice-versa in C or C++?
Hi How to map a user local string (using OS code page) to UTF-8 and vice-versa ? I need send strings between clients and a server (the clients can be linux or windows) and I am thinking in use UTF-8 to change text. What happens if I change a chinese text to UTF-8, send it to the server that locale is english ? Leandro Gustavo Biss Becker ...

Share your Sharing Wisdom
I hope someone can help me out here. In my Outlook I have tons of subordinate folders within Outlook Today and my Inbox. I literally have 104 to be exact. My question is how can I share all of these to another user so they can access EVERYTHING? I know how to give them permission and add my account to their Outlook view but how can I apply permissions to all of the folders instead of doing them one by one? Please help me if you can. I'm scared of the possibility of a daunting task the looms in my forecast. I sincerely appreciate any and all effort one provides in resolving...