Change Excel Download column format to Text?

  • Hi,

    Having an issue where the default column format is General for downloading to Excel, but was hoping I could change it to Text so I can download and send without touching the spreadsheet. Is there some rendering code I could add to download type?

    Thanks

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • I'm interested also if this is possible. I believe not because SSRS is rendering it as Excel.

  • Hi Joe,

    I found the downloaded excel file was in "General" format.

    I needed to submit this file for processing thru an SFTP site, and wouldn't accept it as "General" and needed to be in "TEXT"

    I ended up using a VBA script that I run just prior to submitting it, the .Parent.NumberFormat = "@" changes it to TEXT

    Set xlObj = CreateObject("Excel.Application")

    'Set xlFile = xlObj.Workbooks.Open("c:\temp\filename.xlsx")

    'turn off screen alerts

    xlObj.Application.DisplayAlerts = False

    'loop through sheets

    For Each Worksheet In xlFile.Worksheets

    'change all sheets to desired font

    With Worksheet.Cells.Font

    .Name = "Verdana"

    .Size = 12

    .Parent.NumberFormat = "@"

    End With

    Next

    'save, close, then quit

    xlFile.Close True

    xlObj.Quit

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply