0

I have one c# dll which contain some static variable , I am able set value using UI and now how can i get the get value in VBA ,any Idea?

I wanted to get value of a static variable into VBA , set by some other application.

I have some dll , which contain some static variable.

MWiesner
  • 8,868
  • 11
  • 36
  • 70
  • Have you tried [this](http://stackoverflow.com/questions/1170794/a-simple-c-sharp-dll-how-do-i-call-it-from-excel-access-vba-vb6) ? i'm guessing you added the reference to the dll but it did not work right? – Armando Bracho Aug 11 '16 at 08:25
  • Thanks for your comment but i have already added comVisibliity true , i need to set a static variable from some other domain. and wanted to access this via VBA by creating dll object – Satish Rathore Aug 11 '16 at 09:55
  • is VBA the only way to go for you to set the variable value? may i suggest using an intermediate mean to get that done? for example write value to a DB or a txt file from VBA and then read the value from that source instead – Armando Bracho Aug 11 '16 at 10:41
  • Value is set by some other application into a static variable and i am creating object of that dll in VBA .. but i did not get that value . i think due to different AppDomain. – Satish Rathore Aug 11 '16 at 13:43
  • What about write a wrapper dll which import the first dll. and you can add method to get the static values? – neohope Aug 18 '16 at 11:57

1 Answers1

0

I think its not possible due to different application domain.

I manage to do that , we have saved static value in temp file and read the same.