Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using System.Globalization.CultureInfo from VBScript

I can't figure out how to use the .NET class: System.Globalization.CultureInfo.

According to the documentation, it has ComVisibleAttribute = True, which I thought meant I could use it from VBScript. However, when I try to use it like:

Set ci = CreateObject("System.Globalization.CultureInfo")

I get:

Microsoft VBScript runtime error: ActiveX component can't create object: 'System.Globalization.CultureInfo'

Perhaps I am misunderstanding something, and this class simply cannot be used from VBScript?

like image 231
Eric Avatar asked Dec 08 '25 15:12

Eric


1 Answers

I don't think this is possible... CultureInfo has no parameterless constructor, and CreateObject doesn't allow you to specify constructor arguments

like image 98
Thomas Levesque Avatar answered Dec 11 '25 03:12

Thomas Levesque



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!