Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

pshell, vista & office 2007

Closed Thread
 
Thread Tools Display Modes
Old 03-09-2007   #1 (permalink)
n3llyb0y
Guest


 

pshell, vista & office 2007

Hi All,

I've recently moved to Vista but one of my scripts that was using
office 2007 no longer wants to work. I was hoping someone could shed
some light on this.

I'm calling the excel application

$xl = new-object -comobject "excel.application"

Then try to add a new workbook

$xl.workbooks.add()

and get this error:

Exception calling "Add" with "0" argument(s): "Old format or invalid
type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))

any ideas?

Cheers,
Neil

Old 03-09-2007   #2 (permalink)
Brandon Shell
Guest


 

Re: pshell, vista & office 2007

Worked for me. I dont have office on my x64 Vista so I cant try that... are
you running x64?

--
Brandon Shell
---------------
Stop by my blog some time
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
--------------------------------------

"n3llyb0y" <n3llyb0y@aol.com> wrote in message
news:2007030909483416807-n3llyb0y@aolcom...
> Hi All,
>
> I've recently moved to Vista but one of my scripts that was using office
> 2007 no longer wants to work. I was hoping someone could shed some light
> on this.
>
> I'm calling the excel application
>
> $xl = new-object -comobject "excel.application"
>
> Then try to add a new workbook
>
> $xl.workbooks.add()
>
> and get this error:
>
> Exception calling "Add" with "0" argument(s): "Old format or invalid type
> library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
>
> any ideas?
>
> Cheers,
> Neil
>


Old 03-09-2007   #3 (permalink)
n3llyb0y
Guest


 

Re: pshell, vista & office 2007

On 2007-03-09 14:31:12 +0000, "Brandon Shell" <tshell.mask@gmail.com> said:

> Worked for me. I dont have office on my x64 Vista so I cant try that...
> are you running x64?


No, not using x64.

So it worked on your x86 setup? I think I'll go ahead and re-install
powershell and office.

Thanks for confirming :-)

n

Old 03-10-2007   #4 (permalink)
RichS
Guest


 

Re: pshell, vista & office 2007

I've got the same error. be interested if you find a solution
--
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


"n3llyb0y" wrote:

> On 2007-03-09 14:31:12 +0000, "Brandon Shell" <tshell.mask@gmail.com> said:
>
> > Worked for me. I dont have office on my x64 Vista so I cant try that...
> > are you running x64?

>
> No, not using x64.
>
> So it worked on your x86 setup? I think I'll go ahead and re-install
> powershell and office.
>
> Thanks for confirming :-)
>
> n
>
>

Old 03-10-2007   #5 (permalink)
RichS
Guest


 

Re: pshell, vista & office 2007

Interestingly

Set objExcel = CreateObject("Excel.Application")

objExcel.Visible = True
objExcel.Workbooks.Add


objExcel.Cells(1, 1)= "Computer"
objExcel.Cells(1, 2)= "OU"

works when run in vbscript
--
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


"RichS" wrote:

> I've got the same error. be interested if you find a solution
> --
> 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
>
>
> "n3llyb0y" wrote:
>
> > On 2007-03-09 14:31:12 +0000, "Brandon Shell" <tshell.mask@gmail.com> said:
> >
> > > Worked for me. I dont have office on my x64 Vista so I cant try that...
> > > are you running x64?

> >
> > No, not using x64.
> >
> > So it worked on your x86 setup? I think I'll go ahead and re-install
> > powershell and office.
> >
> > Thanks for confirming :-)
> >
> > n
> >
> >

Old 03-10-2007   #6 (permalink)
Brandon Shell
Guest


 

Re: pshell, vista & office 2007

Very Odd Rich... it works for me on two different machines. Are you using
beta Office or something? What version of office?

"RichS" <RichS@discussions.microsoft.com> wrote in message
news:889BAE28-C125-4A51-AC00-C077EBF77DB2@microsoft.com...
> I've got the same error. be interested if you find a solution
> --
> 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
>
>
> "n3llyb0y" wrote:
>
>> On 2007-03-09 14:31:12 +0000, "Brandon Shell" <tshell.mask@gmail.com>
>> said:
>>
>> > Worked for me. I dont have office on my x64 Vista so I cant try that...
>> > are you running x64?

>>
>> No, not using x64.
>>
>> So it worked on your x86 setup? I think I'll go ahead and re-install
>> powershell and office.
>>
>> Thanks for confirming :-)
>>
>> n
>>
>>


Old 03-11-2007   #7 (permalink)
RichS
Guest


 

Re: pshell, vista & office 2007

As far as I'm aware its not beta. It's a work machine so need to check on
office version. I installed powershell on top of office - wonder if that
matters.

As vbscript works OK - it suggests the interop isn't registered correctly
--
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


"Brandon Shell" wrote:

> Very Odd Rich... it works for me on two different machines. Are you using
> beta Office or something? What version of office?
>
> "RichS" <RichS@discussions.microsoft.com> wrote in message
> news:889BAE28-C125-4A51-AC00-C077EBF77DB2@microsoft.com...
> > I've got the same error. be interested if you find a solution
> > --
> > 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
> >
> >
> > "n3llyb0y" wrote:
> >
> >> On 2007-03-09 14:31:12 +0000, "Brandon Shell" <tshell.mask@gmail.com>
> >> said:
> >>
> >> > Worked for me. I dont have office on my x64 Vista so I cant try that...
> >> > are you running x64?
> >>
> >> No, not using x64.
> >>
> >> So it worked on your x86 setup? I think I'll go ahead and re-install
> >> powershell and office.
> >>
> >> Thanks for confirming :-)
> >>
> >> n
> >>
> >>

>
>

Old 03-11-2007   #8 (permalink)
RichS
Guest


 

RE: pshell, vista & office 2007

Done a bit of digging and found this

http://forums.microsoft.com/MSDN/Sho...68710&SiteID=1

look at the bottom posting in the thread. I'm just going to test it
--
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


"n3llyb0y" wrote:

> Hi All,
>
> I've recently moved to Vista but one of my scripts that was using
> office 2007 no longer wants to work. I was hoping someone could shed
> some light on this.
>
> I'm calling the excel application
>
> $xl = new-object -comobject "excel.application"
>
> Then try to add a new workbook
>
> $xl.workbooks.add()
>
> and get this error:
>
> Exception calling "Add" with "0" argument(s): "Old format or invalid
> type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
>
> any ideas?
>
> Cheers,
> Neil
>
>

Old 03-11-2007   #9 (permalink)
RichS
Guest


 

RE: pshell, vista & office 2007

OK - think I've cracked it.

have a look at this KB article

http://support.microsoft.com/default...b;en-us;320369

The problem is the culture the machine is set to. I'm in the UK so have
en-GB - that clashes with Excel's en-US so won't work. I've chnaged all my
location info to US and it now works. $host.currentculture shows en-US

the code

$xl = New-Object -comobject "excel.application"
$xl.workbooks.add()

now works. Brandon - I think you are US based so thats why it worked.

Fix is to install MUI pack or to modify code in KB article for powershell.
Easiest is to use MUI

--
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


"RichS" wrote:

> Done a bit of digging and found this
>
> http://forums.microsoft.com/MSDN/Sho...68710&SiteID=1
>
> look at the bottom posting in the thread. I'm just going to test it
> --
> 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
>
>
> "n3llyb0y" wrote:
>
> > Hi All,
> >
> > I've recently moved to Vista but one of my scripts that was using
> > office 2007 no longer wants to work. I was hoping someone could shed
> > some light on this.
> >
> > I'm calling the excel application
> >
> > $xl = new-object -comobject "excel.application"
> >
> > Then try to add a new workbook
> >
> > $xl.workbooks.add()
> >
> > and get this error:
> >
> > Exception calling "Add" with "0" argument(s): "Old format or invalid
> > type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
> >
> > any ideas?
> >
> > Cheers,
> > Neil
> >
> >

Old 03-11-2007   #10 (permalink)
Brandon Shell
Guest


 

Re: pshell, vista & office 2007

gj Rich. See... curiosity doesn't always kill that cat.

"RichS" <RichS@discussions.microsoft.com> wrote in message
news:2954C28A-B83A-44C7-886A-617DF431215C@microsoft.com...
> OK - think I've cracked it.
>
> have a look at this KB article
>
> http://support.microsoft.com/default...b;en-us;320369
>
> The problem is the culture the machine is set to. I'm in the UK so have
> en-GB - that clashes with Excel's en-US so won't work. I've chnaged all
> my
> location info to US and it now works. $host.currentculture shows en-US
>
> the code
>
> $xl = New-Object -comobject "excel.application"
> $xl.workbooks.add()
>
> now works. Brandon - I think you are US based so thats why it worked.
>
> Fix is to install MUI pack or to modify code in KB article for powershell.
> Easiest is to use MUI
>
> --
> 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
>
>
> "RichS" wrote:
>
>> Done a bit of digging and found this
>>
>> http://forums.microsoft.com/MSDN/Sho...68710&SiteID=1
>>
>> look at the bottom posting in the thread. I'm just going to test it
>> --
>> 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
>>
>>
>> "n3llyb0y" wrote:
>>
>> > Hi All,
>> >
>> > I've recently moved to Vista but one of my scripts that was using
>> > office 2007 no longer wants to work. I was hoping someone could shed
>> > some light on this.
>> >
>> > I'm calling the excel application
>> >
>> > $xl = new-object -comobject "excel.application"
>> >
>> > Then try to add a new workbook
>> >
>> > $xl.workbooks.add()
>> >
>> > and get this error:
>> >
>> > Exception calling "Add" with "0" argument(s): "Old format or invalid
>> > type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
>> >
>> > any ideas?
>> >
>> > Cheers,
>> > Neil
>> >
>> >


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista- Office 2007 and Microsoft Office Outlook Andy Vista mail 8 05-19-2008 08:05 PM
Problem with Vista/Office 2007 & SharePoint 2007 Subbu Vista networking & sharing 2 03-27-2008 08:18 PM
Office 2003, Office 2007 and Vista MManry Vista General 2 01-14-2008 03:29 PM
Q&A: Microsoft Office Accounting Express 2007 and Office Accounting Professional 2007 Build ‘Onramp’ to Internet Economy for Small Businesses z3r010 Vista News 0 11-08-2006 03:06 PM
Q&A: Microsoft Office Accounting Express 2007 and Office Accounting Professional 2007 Build ‘Onramp’ to Internet Economy for Small Businesses z3r010 Vista News 0 10-30-2006 12:04 AM








Vistax64.com 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 2005-2008

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 47 48 49 50