View Single Post
Old 11-08-2007   #3 (permalink)
Patrick Ogenstad


 
 

Re: CTP: Culture and Office still a problem

Hello Richard,

Thanks for your response!

Ah, yes I remember hearing about that however in other languages you have
the ability to change the culture inside the program. (as far as I know that
is)

Even if the problem is related to Office it would be great if you could
change the culture for the current scope in PowerShell.

Cheers
Patrick
http://ogenstad.net

"RichS" <RichS@xxxxxx> wrote in message
news:6323E08A-290E-45CE-B62D-5ED228C074B9@xxxxxx
Quote:

> Its is really an Excel issue as it fails in the same way if you try the
> call
> in a .NET program
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "Patrick Ogenstad" wrote:
>
Quote:

>> Hello,
>>
>> When I saw the CTP I was hoping I would be able to run scripts like:
>>
>> $a = New-Object -comobject Excel.Application
>>
>> $a.Visible = $True
>>
>> $b = $a.Workbooks.Add()
>> $c = $b.Worksheets.Item(1)
>>
>> $c.Cells.Item(1,1) = "A value in cell A1."
>>
>> Though after the "Workbooks.Add()" I get this error message:
>>
>> Exception calling "Add" with "0" argument(s): "Old format or invalid type
>> library. (Exception from HRESULT: 0x80028018
>> (TYPE_E_INVDATAREAD))"
>> At line:1 char:22
>> + $b = $a.Workbooks.Add( <<<< )
>>
>> *Note this is not a new issue, we had this in PowerShell 1.0 too.
>>
>> The cause is that I'm not using the "en-US" culture, if I change the
>> culture
>> to en-US everything runs fine.
>>
>> I know there are ways to code around the problem. But in my opinion I
>> shouldn't have to do this, in almost every example a PowerShell script is
>> shorter than a VBScript however when it comes to coding against Office I
>> would prefer using VBScript at the moment.
>>
>> Is there any chance of seeing this getting into PowerShell 2.0? If not is
>> there any kind of roadmap or plan as to when or how this might get fixed?
>>
>> Anyway, it's great to see new development with PowerShell!
>>
>> Best regards
>> Patrick
>> http://ogenstad.net
>>
My System SpecsSystem Spec