Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

VB Script to create and format Excel file

Avatar of bwbpro
bwbpro asked on
Microsoft SQL ServerVisual Basic ClassicVB Script
9 Comments1 Solution8484 ViewsLast Modified:
I have created a DTS Package in SQL the runs a query and creates an Excel file with that data.  I would like to be able to create the file with some basic formatting (column widths, row height, font & font  size by row or column.  The DTS package creates a VB Transformation script that I will attach below.  Does anyone if it is possible and if so, how I can add sript to this that will include the type of formatting mentioned above?  FYI...I know very little about programming and Visual Basic.  I just started to teach myself some basics but I'm about as gren as it gets.  Thanks in advance for any help you can provide!  Brett

Here is the script:

'**********************************************************************
'  Visual Basic Transformation Script
'  Copy each source column to the
'  destination column
'************************************************************************

Function Main()
      DTSDestination("OrderNumber") = DTSSource("OrderNumber")
      DTSDestination("OrderDate") = DTSSource("OrderDate")
      DTSDestination("Customer") = DTSSource("Customer")
      DTSDestination("DocumentType") = DTSSource("DocumentType")
      DTSDestination("Project") = DTSSource("Project")
      DTSDestination("Rep_1") = DTSSource("Rep_1")
      DTSDestination("Rep_2") = DTSSource("Rep_2")
      Main = DTSTransformStat_OK
End Function
ASKER CERTIFIED SOLUTION
Avatar of cybeh
cybeh

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answers