Get-WMIObject Win32_ClassicCOMClassSetting | ? {$_.VersionIndependentProgId
-like 'excel.application'}
Assuming this does return information are the paths correct
Can the vbscript method CreateObject instanciate Excel?
"Shyam K" wrote:
> Hi All,
>
> am copying the data from sql server to excel by using power shell.
> when am executing the following power shell script am getting the error
> Error
> ------
> New-Object : Cannot load COM type Excel.Application.
> At line:1 char:17
> + $xl = New-Object <<<< -comobject Excel.Application
>
>
> Power shell script
> ------------------------
> $xl = New-Object -comobject Excel.Application
> $xl.visible=$true
> $workbook = $xl.workbooks.open("F:\DBA\Scripts\Output\Allocation_Usage.xls")
> $sheet = $workbook.worksheets | where {$_.name -eq "Mar 09"}
I get that if I try to run the script on a computer that does not have
Excel installed.
If you are running it on your SQL server, it may not have Excel
installed.
even in VB script also am getting the error.
"Microsoft VBScript runtime error: ActiveX component can't create object:
'Excel.Application'"
we have not installed office.
I need clarification that with out installing office / excel can we use the
excel software.
we are able to create excel file by SSIS.
So the next question is what is the end result you are after?
SSIS write out a number of different formats. Unless what you'll be doing is
truely numerically intensive I suspect you can get by writing it out as a XML
or CSV file and working from there.