Results 1 to 1 of 1

Thread: Problem in Dynamic Excel File in DTS Package..??

  1. #1
    Join Date
    Sep 2005
    Posts
    43

    Question How to increase row size in Excel File inside a DTS Package..??

    Function Main()
    Dim appExcel
    Dim newBook
    Dim oSheet
    dim oPackage
    dim oConn

    Set appExcel = CreateObject("Excel.Application")
    Set newBook = appExcel.Workbooks.Add
    Set oSheet = newBook.Worksheets(1)

    'Specify the column name in the Excel worksheet

    oSheet.Range("A1").Value = "au_lname"
    oSheet.Range("B1").Value = "au_fname"
    oSheet.Range("C1").Value = "phone"
    oSheet.Range("D1").Value = "address"
    oSheet.Range("E1").Value = "city"


    'Specify the name of the new Excel file to be created

    DTSGlobalVariables("fileName").Value = "C:\" & Month(Now) & "-" &
    Day(Now) & "-" & Year(Now) & "-" & Hour(Time) & "-" &Minute(Time) & "-" &
    Second(Time) & ".xls"

    With newBook
    .SaveAs DTSGlobalVariables("fileName").Value
    .save
    End With

    appExcel.quit

    'dynamically specify the destination Excel file

    set oPackage = DTSGlobalVariables.parent

    ‘connection 2 is to the Excel file
    set oConn = oPackage.connections(2)
    oConn.datasource = DTSGlobalVariables("fileName").Value

    set oPackage = nothing
    set oConn = nothing

    Main = DTSTaskExecResult_Success

    End Function
    -------------------------------------------------
    Once the file is created the default datatype is for all column headers is Varchar(255)..
    I want it to be Varchar(1500) or Long text so that the Excel row can take string greater than 255Characters...

    any idea........ Please help ...Thanks
    Last edited by bobkand; 03-16-2006 at 12:18 PM. Reason: No responces......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •