![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#3
| |||
| |||
|
|
How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#4
| |||
| |||
|
|
John, This code snippet should be inserted into an Active X Script task at the beginning of your package: ' Now set the Excel Filename on the Connection Set oPkg = DTSGlobalVariables.Parent Set oConn = oPkg.Connections("Connection Summary 1") oConn.DataSource = DTSGlobalVariables("FileName").Value oConn.ConnectionProperties("Extended Properties").Value = "Excel 8.0;HDR=NO" ' HDR = YES means generate column header in exported Excel file Thank you. "jaryr" wrote: How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#5
| |||
| |||
|
|
Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#6
| |||
| |||
|
|
Yes, I am aware of HDR=YES/NO in Extended Properties of the Excel connection object. The problem is that when DTS package has to generate Excel file it creates additional task with a script CREATE TABLE .... This task adds headers to Excel file no matter what I include in Extended Properties. Any idea how I can overcome this problem? Thank you very much, John "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:eephw8ooFHA.1088 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#7
| |||
| |||
|
|
John, I just checked the DTS package I wrote which exports to Excel and I set HDR = NO in the Extended Properties of the Excel connection and it works fine. Have you tried Allan Mitchell's other solutions in his article? If it is OK with you , could you please post excerpts of your Active X Script code? Also, once the data transformation into your Excel named range, you can used the Excel COM object model so that the column header never shows. Thank you. "jaryr" wrote: Yes, I am aware of HDR=YES/NO in Extended Properties of the Excel connection object. The problem is that when DTS package has to generate Excel file it creates additional task with a script CREATE TABLE .... This task adds headers to Excel file no matter what I include in Extended Properties. Any idea how I can overcome this problem? Thank you very much, John "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:eephw8ooFHA.1088 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#8
| |||
| |||
|
|
I use Disconnected Edit option to set Extended Properties as per Allan Mitchell's solution. When I try to export to existing spreadsheet it works fine, once the spreadsheet is generated by my DTS Package, the headers are generated no matter what I set up in in Extended Properties. In the DTS Package you wrote are you exporting to exsisting spreadsheet? Thanks, John "frank chang" <frankchang (AT) discussions (DOT) microsoft.com> wrote in message news:F5F1E1B2-840F-40AE-9773-EB59996BBA06 (AT) microsoft (DOT) com... John, I just checked the DTS package I wrote which exports to Excel and I set HDR = NO in the Extended Properties of the Excel connection and it works fine. Have you tried Allan Mitchell's other solutions in his article? If it is OK with you , could you please post excerpts of your Active X Script code? Also, once the data transformation into your Excel named range, you can used the Excel COM object model so that the column header never shows. Thank you. "jaryr" wrote: Yes, I am aware of HDR=YES/NO in Extended Properties of the Excel connection object. The problem is that when DTS package has to generate Excel file it creates additional task with a script CREATE TABLE .... This task adds headers to Excel file no matter what I include in Extended Properties. Any idea how I can overcome this problem? Thank you very much, John "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:eephw8ooFHA.1088 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#9
| |||
| |||
|
|
John, In the test I just did, I am trying to export the result of a SQL Server query to a named range on a new Excel worksheet. I create the Excel worksheet using an Excel COM object method in a DTS Task just before the DTS Data Transformation Task. Before the DTS package runs, no Excel spreadsheet exists. The name of the new excel worksheet is "ABCDEFG" + today's date and time + ".xls". However, my package is slightly different than yours in that I am trying to export to a named range on this new spreadsheet. I know that you can avoid having to deal with Extended Properties, if you move the data around on your exported Excel spreadsheet , after the DTS Data Transformation Task, using an Excel COM Object model method so that the column headers are overwritten. I don't know what your constraints and specifications are so I don't know if this will help you. Thank you. "jaryr" wrote: I use Disconnected Edit option to set Extended Properties as per Allan Mitchell's solution. When I try to export to existing spreadsheet it works fine, once the spreadsheet is generated by my DTS Package, the headers are generated no matter what I set up in in Extended Properties. In the DTS Package you wrote are you exporting to exsisting spreadsheet? Thanks, John "frank chang" <frankchang (AT) discussions (DOT) microsoft.com> wrote in message news:F5F1E1B2-840F-40AE-9773-EB59996BBA06 (AT) microsoft (DOT) com... John, I just checked the DTS package I wrote which exports to Excel and I set HDR = NO in the Extended Properties of the Excel connection and it works fine. Have you tried Allan Mitchell's other solutions in his article? If it is OK with you , could you please post excerpts of your Active X Script code? Also, once the data transformation into your Excel named range, you can used the Excel COM object model so that the column header never shows. Thank you. "jaryr" wrote: Yes, I am aware of HDR=YES/NO in Extended Properties of the Excel connection object. The problem is that when DTS package has to generate Excel file it creates additional task with a script CREATE TABLE .... This task adds headers to Excel file no matter what I include in Extended Properties. Any idea how I can overcome this problem? Thank you very much, John "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:eephw8ooFHA.1088 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
#10
| |||
| |||
|
|
I have to create a generic server side component (in VB 6) which will export data from SQl 2K server to excel file by building DTS package at runtime. There are no Excel objects on the server so the approach you are using is not an option for me, Microsoft.JET.OLEDB.4.0 is the only available thing I can use. Looks like I have two options: 1. Generate empty Excel template file and just before generating DTS package copy it and use a copy as a export destination file. 2. Forget about option of exporting to Excel with no column headers. Thank you very much for all you help, John "frank chang" <frankchang (AT) discussions (DOT) microsoft.com> wrote in message news:450D3ABA-C8BF-4589-875F-52D7B096437A (AT) microsoft (DOT) com... John, In the test I just did, I am trying to export the result of a SQL Server query to a named range on a new Excel worksheet. I create the Excel worksheet using an Excel COM object method in a DTS Task just before the DTS Data Transformation Task. Before the DTS package runs, no Excel spreadsheet exists. The name of the new excel worksheet is "ABCDEFG" + today's date and time + ".xls". However, my package is slightly different than yours in that I am trying to export to a named range on this new spreadsheet. I know that you can avoid having to deal with Extended Properties, if you move the data around on your exported Excel spreadsheet , after the DTS Data Transformation Task, using an Excel COM Object model method so that the column headers are overwritten. I don't know what your constraints and specifications are so I don't know if this will help you. Thank you. "jaryr" wrote: I use Disconnected Edit option to set Extended Properties as per Allan Mitchell's solution. When I try to export to existing spreadsheet it works fine, once the spreadsheet is generated by my DTS Package, the headers are generated no matter what I set up in in Extended Properties. In the DTS Package you wrote are you exporting to exsisting spreadsheet? Thanks, John "frank chang" <frankchang (AT) discussions (DOT) microsoft.com> wrote in message news:F5F1E1B2-840F-40AE-9773-EB59996BBA06 (AT) microsoft (DOT) com... John, I just checked the DTS package I wrote which exports to Excel and I set HDR = NO in the Extended Properties of the Excel connection and it works fine. Have you tried Allan Mitchell's other solutions in his article? If it is OK with you , could you please post excerpts of your Active X Script code? Also, once the data transformation into your Excel named range, you can used the Excel COM object model so that the column header never shows. Thank you. "jaryr" wrote: Yes, I am aware of HDR=YES/NO in Extended Properties of the Excel connection object. The problem is that when DTS package has to generate Excel file it creates additional task with a script CREATE TABLE .... This task adds headers to Excel file no matter what I include in Extended Properties. Any idea how I can overcome this problem? Thank you very much, John "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:eephw8ooFHA.1088 (AT) TK2MSFTNGP14 (DOT) phx.gbl... Have a look at this article Excel treats First Row of Data as Headers (http://www.sqldts.com/default.aspx?255) "jaryr" <najyer (AT) hotmail (DOT) com> wrote in message news:ugvvW6moFHA.3760 (AT) TK2MSFTNGP15 (DOT) phx.gbl... How to build a DTS Package so it will generated excel file without column headers? Any help is appreciated. John |
![]() |
| Thread Tools | |
| Display Modes | |
| |