Excel import reg

Discussion in 'Tally Developer' started by Murali.R, Aug 2, 2025.

  1. Murali.R

    Murali.R Member


    please help me on excell import , I want sheet name default possition first Sheet , plese sugest experts

    advance thanks to all

    [Collection : ExPurchase Import Excel]
    ODBC : "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + @@XLTotFilePath
    SQL : "Select * from [Sheet1$]"

    i don't want fix the sheet name, i want first sheet name defualt
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Kindly Use OPENAI --- with your above query ---
    you might get your answer.
     


  3. Murali.R

    Murali.R Member


    i will not understand sir, please (sample)guide me sir
     
    Last edited: Aug 2, 2025


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    In TDL (Tally Definition Language), when importing from Excel using ODBC, the sheet name must be explicitly mentioned in the SQL query (e.g., [Sheet1$]). Unfortunately, ODBC for Excel does not natively support dynamic selection of the "first sheet" unless the sheet name is known or fetched externally.

    So in Excel that Sheet you need must always have the name "Sheet1" OR you can use VBScript or Powershell.

    Before Tally runs the import, a small external script (VBScript or Powershell) can:
    1. Open the Excel file.
    2. Get the name of the first worksheet.
    3. Save it to a text file or pass it to TDL using a System Variable.
    4. Use that in the TDL ODBC string.
     


  5. Murali.R

    Murali.R Member


    thanks sir, i will understand
     


Share This Page