Export and Hiding Columns

  • Morning all!

    I would like to export all the data from a table to an Excel spreadsheet, but I would like certain columns in the spreadsheet to be hidden without user intervention.

    Is this possible through T-SQL or Active Scripting or any other method?

    Thanks

  • Try using a SELECT statement

    Use SELECT Col1, Col3, ... ColN instead of SELECT *

  • Jeff:  Thanks for the response, but I think that I should clarify...

    I want to export all the columns to an excell spreadsheet, but I want to 'hide' certain columns without having to first open the spreadsheet and hiding them manually by right clicking and selecting hide.

    I know that this is possible with VB, but I'm trying to figure out a way to do it using the SQL server.

    Thanks again,

  • How are you getting the data from SQL to Excel? 

  • I'm either going to use a DTS or use our e-mailer program which creates spreadsheets based on a select statement.

    I think, however, that i have found my answer.

    The solution is to export the data into an established Excel spreadsheet template that already contain some VBA code which hides the columns when the spreadsheet is launched or opened.

    Regards,

    Justyna

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

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