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
>