Link to home
Start Free TrialLog in
Avatar of CreativeLite
CreativeLite

asked on

iPhone opening excel file SSIS execute small console application

I have encountered the problem of iPhones and iPads not opening excel attachments. I get a gray image with the name of the xls file. If I send xlsx I get one blank box. I have learned that if AFTER I create the excel file with SSIS, I open the file with excel, refresh and save then close the file, then use dbsendmail to attach the xlsx it will open fine. I am getting an error though that says "Can't create activex object" when I run the stored procedure that includes calling the windows exe below. It runs perfectly if I double click it. I also tried running it as an execute process task and it fails with the can't create activex error. Why can't I run this with a stored procedure or SSIS Process task?

Module Module1

    Public Sub Main()
        ' Create an Excel instance
        Dim oExcel
        Dim oWorkbook
        oExcel = CreateObject("Excel.Application")
        ' Disable Excel UI elements
        oExcel.Visible = True
        oExcel.DisplayAlerts = False
        oExcel.AskToUpdateLinks = False
        oExcel.AlertBeforeOverwriting = False

        oWorkbook = oExcel.Workbooks.Open("D:\export\temp\aDailyTransfer.xlsx")
        oWorkbook.RefreshAll()
        oWorkbook.Save()

        oExcel.Quit()
        oWorkbook = Nothing
        oExcel = Nothing
    End Sub

End Module
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial