Error HRESULT E_FAIL has been returned from a call to a COM component.

jcher

New member
Joined
Nov 29, 2007
Messages
2
Programming Experience
5-10
I'm getting the error shown in the subject line of this post when I run the following code. I'm creating a new excel spreadheet, then I'm opening up a powerpoint file and modifying the Object links (where applicable in each slide) to point to this new excel file. Any insight from anyone would be greatly appreciated. thanks


VB.NET:
        data_file = Me.SaveFileDialog1.FileName
        objWorkbook2.SaveAs(data_file)
        objWorkbook2.Close()


        objExcelapp.Quit()
        For i = 1 To slide_count
            Select Case (i)
                Case 1
                    For j = 1 To shape_count
                        If ppt_val.Slides(i).Shapes(j).Type = MsoShapeType.msoLinkedOLEObject Then
                            ppt_val.Slides(i).Shapes(j).LinkFormat.SourceFullName = data_file
                        End If
                    Next

                Case 2
                    For j = 1 To shape_count2
                        If ppt_val.Slides(i).Shapes(j).Type = MsoShapeType.msoLinkedOLEObject Then
                            ppt_val.Slides(i).Shapes(j).LinkFormat.SourceFullName = data_file
                        End If
                    Next
            End Select
        Next
 
Last edited by a moderator:
Back
Top