Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista Tutorial - CTP: Culture and Office still a problem

Reply
 
Old 11-08-2007   #1 (permalink)
Patrick Ogenstad
Guest


 
 

CTP: Culture and Office still a problem

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
Old 11-08-2007   #2 (permalink)
RichS
Guest


 
 

RE: CTP: Culture and Office still a problem

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
Old 11-08-2007   #3 (permalink)
Patrick Ogenstad
Guest


 
 

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
Old 11-08-2007   #4 (permalink)
RichS
Guest


 
 

Re: CTP: Culture and Office still a problem

I agree that being able to change the culture would be a big help - maybe the
gloabalisation\localisation features will eventually give us that
--
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 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
Old 11-08-2007   #5 (permalink)
Kirk Munro
Guest


 
 

Re: CTP: Culture and Office still a problem

I hope so. It would greatly facilitate sanity testing of localized scripts.
I was looking for this feature in version 1.0 a while ago when working with
localized help information and using PowerShell with the MUI
pack...switching machines/accounts to test various locales is too onerous
when working out the details of a script.

--
Kirk Munro
Poshoholic
http://poshoholic.com


"RichS" <RichS@xxxxxx> wrote in message
newsA2AB100-89B1-4787-82E7-2542DAAA149B@xxxxxx
Quote:

>I agree that being able to change the culture would be a big help - maybe
>the
> gloabalisation\localisation features will eventually give us that
> --
> 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 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:
>> >
>> >> 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
Old 11-09-2007   #6 (permalink)
Patrick Ogenstad
Guest


 
 

Re: CTP: Culture and Office still a problem

I'm sure a lot of people would find this useful. Perhaps someone at
Microsoft could let us know if this is something which is being addressed?

Patrick
http://ogenstad.net


"Kirk Munro" <sorry@xxxxxx> wrote in message
news:%23F9%23FEnIIHA.1184@xxxxxx
Quote:

>I hope so. It would greatly facilitate sanity testing of localized
>scripts. I was looking for this feature in version 1.0 a while ago when
>working with localized help information and using PowerShell with the MUI
>pack...switching machines/accounts to test various locales is too onerous
>when working out the details of a script.
>
> --
> Kirk Munro
> Poshoholic
> http://poshoholic.com
>
>
> "RichS" <RichS@xxxxxx> wrote in message
> newsA2AB100-89B1-4787-82E7-2542DAAA149B@xxxxxx
Quote:

>>I agree that being able to change the culture would be a big help - maybe
>>the
>> gloabalisation\localisation features will eventually give us that
>> --
>> 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 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
>>> > 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:
>>> >
>>> >> 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
Old 11-14-2007   #7 (permalink)
Lee Holmes [MSFT]
Guest


 
 

Re: CTP: Culture and Office still a problem

Check out this script Jeffrey blogged in April of '05 --
http://blogs.gotdotnet.com/powershel...25/583235.aspx.

--
Lee Holmes [MSFT]
Windows PowerShell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.


"Patrick Ogenstad" <patrick.ogenstad@xxxxxx> wrote in message
news:0FFDA4F1-9E01-4A4E-AC1F-8E9F8468E2B0@xxxxxx
Quote:

> I'm sure a lot of people would find this useful. Perhaps someone at
> Microsoft could let us know if this is something which is being addressed?
>
> Patrick
> http://ogenstad.net
>
>
> "Kirk Munro" <sorry@xxxxxx> wrote in message
> news:%23F9%23FEnIIHA.1184@xxxxxx
Quote:

>>I hope so. It would greatly facilitate sanity testing of localized
>>scripts. I was looking for this feature in version 1.0 a while ago when
>>working with localized help information and using PowerShell with the MUI
>>pack...switching machines/accounts to test various locales is too onerous
>>when working out the details of a script.
>>
>> --
>> Kirk Munro
>> Poshoholic
>> http://poshoholic.com
>>
>>
>> "RichS" <RichS@xxxxxx> wrote in message
>> newsA2AB100-89B1-4787-82E7-2542DAAA149B@xxxxxx
Quote:

>>>I agree that being able to change the culture would be a big help - maybe
>>>the
>>> gloabalisation\localisation features will eventually give us that
>>> --
>>> 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:
>>>
>>>> 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
>>>> > 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:
>>>> >
>>>> >> 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
Old 11-16-2007   #8 (permalink)
Patrick Ogenstad
Guest


 
 

Re: CTP: Culture and Office still a problem

Hello Lee,

Thanks for your update!

I've seen that script unfortunatly that code doesn't work when you call an
office application.

However there is some example code for this here:
http://www.codeplex.com/psexpect

Also when it comes to Excel you can just treat it as a database and collect
the data that way.

As it is today it's easier to use vbscript while working with Office.

If you have the time to change your culture do a quick test to see what you
have to do in order to get Office working from PowerShell. Compared to
VBscript it's not fun.

Best regards
Patrick
http://ogenstad.net



"Lee Holmes [MSFT]" <leeholm@xxxxxx> wrote in message
news:473b25d6$1@xxxxxx
Quote:

> Check out this script Jeffrey blogged in April of '05 --
> http://blogs.gotdotnet.com/powershel...25/583235.aspx.
>
> --
> Lee Holmes [MSFT]
> Windows PowerShell Development
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
> "Patrick Ogenstad" <patrick.ogenstad@xxxxxx> wrote in message
> news:0FFDA4F1-9E01-4A4E-AC1F-8E9F8468E2B0@xxxxxx
Quote:

>> I'm sure a lot of people would find this useful. Perhaps someone at
>> Microsoft could let us know if this is something which is being
>> addressed?
>>
>> Patrick
>> http://ogenstad.net
>>
>>
>> "Kirk Munro" <sorry@xxxxxx> wrote in message
>> news:%23F9%23FEnIIHA.1184@xxxxxx
Quote:

>>>I hope so. It would greatly facilitate sanity testing of localized
>>>scripts. I was looking for this feature in version 1.0 a while ago when
>>>working with localized help information and using PowerShell with the MUI
>>>pack...switching machines/accounts to test various locales is too onerous
>>>when working out the details of a script.
>>>
>>> --
>>> Kirk Munro
>>> Poshoholic
>>> http://poshoholic.com
>>>
>>>
>>> "RichS" <RichS@xxxxxx> wrote in message
>>> newsA2AB100-89B1-4787-82E7-2542DAAA149B@xxxxxx
>>>>I agree that being able to change the culture would be a big help -
>>>>maybe the
>>>> gloabalisation\localisation features will eventually give us that
>>>> --
>>>> 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:
>>>>
>>>>> 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
>>>>> > 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:
>>>>> >
>>>>> >> 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
Reply

Thread Tools


Similar Threads
Thread Forum
Could not find any resources appropriate for the specified culture or the neutral culture .NET General
System Culture Changed event in Vista? Vista General
Problem Report -Office Stopped Working - Office 2003 Pro Vista General
what does computer culture say about when to uninstqall-and-reinst Vista performance & maintenance


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46