Object from variable

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

Hi,

I am sorry if it has been discuss before I searched and could not find.

I want to create object from variable. I have name of Crystal Report in
Table and I want to create object from variable
any idea or clue

Thanks

Sohail
 
Hi,

Strange question in my eyes, however

Dim a as new object
a = "Whatever you want and whatever value you want"

I don't know if this is what you were after,

Cor
 
Thanks for your reply, I think i was not clear in my problem.

normally it is
dim rpt as rptBudget = new rptBudget

rpt Budget is a Crystal Report

I want to do somehting like this
xyz = "rptBudget"
how can i create object of xyz
 
Use Activator.CreateInstance. For example:



theObject =
Activator.CreateInstance(Type.GetTypeFromProgID("MyNamespace.MyType"))
 
Back
Top