Creating Excel Spreadsheets In Vista

Last post 06-19-2008, 9:37 AM by StephenB. 0 replies.
Sort Posts: Previous Next
  •  06-19-2008, 9:37 AM Post number 60159

    Creating Excel Spreadsheets In Vista

    Help,

    I have been successfully creating Excel spreadsheets via SQL for months. I get a new laptop with Vista and it stops working.

    I can create the Excel application, I can add a workbook, but I CANNOT add a worksheet to the workbook.

    I suspect that some Vista security is requesting that I confirm wanting to add a worksheet, so everything just hangs. Anyhelp would be much appreciated. Code snippet below.

     

    Stephen

    --Create Excel application

    EXEC @HR = sp_OACreate 'Excel.Application', @objExcel OUT

    --create a workbook

    EXEC @HR = sp_OAGetProperty @objExcel, 'WorkBooks.Add', @objWorkBook OUT 

    --add a worksheet

    EXEC @HR = sp_OAGetProperty @objWorkBook, 'WorkSheets.Add', @objWorkSheet OUT 

View as RSS news feed in XML