I am lost as to what to do now. I am trying to be able to change the file that I use in the DTS package. It won't change the file though. It just keeps the one that is saved in the package. This is my coding so far:
Code:
 'change DTS Package
        Dim oPKG As DTS.Package, oStep As DTS.Step
        oPKG = New DTS.Package
        Dim oConn As DTS.Connection

        Dim sServer As String, sUsername As String, sPassword As String
        Dim sPackageName As String, sMessage As String
        Dim lErr As Long, sSource As String, sDesc As String

        ' Set Parameter Values
        sServer = "CRSERVER"
        sUsername = "brenda"
        sPassword = "g_Password"
        sPackageName = "ImportNewAccurintDataHigh"

        ' Load Package
        oPKG.LoadFromSQLServer(sServer, sUsername, sPassword, _
            DTS.DTSSQLServerStorageFlags.DTSSQLStgFlag_UseTrustedConnection, , , , sPackageName)

        'Set Filename
        Dim ofd As New OpenFileDialog
        With ofd
            .Title = "Choose An Excel File"
            .InitialDirectory = "C:\Accurint\"
            .Filter = "XLS (*.xls)|*.xls|All files (*.*)|*.*"
            .FilterIndex = 2
            .RestoreDirectory = True
            .Multiselect = False
        End With
        ofd.ShowDialog()
        oPKG.Connections.Item("Connection 1").DataSource = ofd.FileName
        oConn = Nothing

        ' Set Exec on Main Thread
        For Each oStep In oPKG.Steps
            oStep.ExecuteInMainThread = True
        Next


        ' Execute
        oPKG.Execute()

        ' Get Status and Error Message
        For Each oStep In oPKG.Steps
            If oStep.ExecutionResult = DTS.DTSStepExecResult.DTSStepExecResult_Failure Then
                oStep.GetExecutionErrorInfo(lErr, sSource, sDesc)
                sMessage = sMessage & "Step """ & oStep.Name & _
                    """ Failed" & vbCrLf & _
                    vbTab & "Error: " & lErr & vbCrLf & _
                    vbTab & "Source: " & sSource & vbCrLf & _
                    vbTab & "Description: " & sDesc & vbCrLf & vbCrLf
            Else
                sMessage = sMessage & "Step """ & oStep.Name & _
                    """ Succeeded" & vbCrLf & vbCrLf
            End If
        Next

        oPKG.UnInitialize()

        oStep = Nothing
        oPKG = Nothing
Please help!

Brenda