Click here to Skip to main content
15,891,943 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How do i send email only using API Pin
Rizon4068-Feb-07 4:32
Rizon4068-Feb-07 4:32 
QuestionToken error Message Pin
Zamora Dias8-Feb-07 3:00
Zamora Dias8-Feb-07 3:00 
AnswerRe: Token error Message Pin
Colin Angus Mackay8-Feb-07 3:21
Colin Angus Mackay8-Feb-07 3:21 
QuestionDeployment and Updates Pin
wildfire23238-Feb-07 2:49
wildfire23238-Feb-07 2:49 
QuestionThe disappearing datagrid (vertical) scrollbar Pin
Johan Hakkesteegt8-Feb-07 2:25
Johan Hakkesteegt8-Feb-07 2:25 
QuestionCopy file to network drive in VB6 [modified] Pin
jclito8-Feb-07 2:23
jclito8-Feb-07 2:23 
QuestionManipulating Excel Sheet through VB Pin
darkturtle8-Feb-07 2:23
darkturtle8-Feb-07 2:23 
QuestionManipulating Excel Sheet through VB Pin
darkturtle8-Feb-07 2:23
darkturtle8-Feb-07 2:23 
Hi all,
Quick question, I am trying to save a data table to a excel work sheet, but I want to format it, so that it saves with nice borders and the text is aligned etc.

Could any one point me in the direction of this information. I know how to change the text etc, but not how to add borders, align text or anything else. I have included some code below for what I know how to do but I am lost on how to bring it further. - I have tried some obvious lines of code to try and get to text align functions but nothing works???





Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object

'Start a new workbook in Excel.
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add

'Add data to cells of the first worksheet in the new workbook.
oSheet = oBook.Worksheets(1)


With oExcel
.Range("A2").Resize(workTable.Columns.Count, workTable.Rows.Count + 1).Value = DataArray
.Columns("A:W").ColumnWidth = 18
.Rows("1:20").RowHeight = 15
.Rows("5").RowHeight = 30
.Columns.Wraptext = True
.Rows.Wraptext = True
With .Selection.Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.ColorIndex = 5
End With
End With
Questiontimer Pin
Sebastian T Xavier8-Feb-07 1:16
Sebastian T Xavier8-Feb-07 1:16 
AnswerRe: timer Pin
Johan Hakkesteegt8-Feb-07 2:11
Johan Hakkesteegt8-Feb-07 2:11 
GeneralRe: timer Pin
Sebastian T Xavier8-Feb-07 4:04
Sebastian T Xavier8-Feb-07 4:04 
GeneralRe: timer Pin
Johan Hakkesteegt8-Feb-07 20:27
Johan Hakkesteegt8-Feb-07 20:27 
GeneralRe: timer Pin
Ahmed El-Badry10-Feb-07 0:27
Ahmed El-Badry10-Feb-07 0:27 
QuestionCombobox in Datagridview ,Wnt Click Event Pin
priya_p2338-Feb-07 0:44
priya_p2338-Feb-07 0:44 
QuestionPlace application on top of all other application Pin
ravihd8-Feb-07 0:25
ravihd8-Feb-07 0:25 
AnswerRe: Place application on top of all other application Pin
Christian Graus8-Feb-07 0:32
protectorChristian Graus8-Feb-07 0:32 
Questionmail with embeded images Pin
safalmittal7-Feb-07 23:55
safalmittal7-Feb-07 23:55 
QuestionForm Minimize Event Pin
MatthysDT7-Feb-07 23:40
MatthysDT7-Feb-07 23:40 
AnswerRe: Form Minimize Event Pin
Johan Hakkesteegt7-Feb-07 23:43
Johan Hakkesteegt7-Feb-07 23:43 
QuestionSorting with DataGrid & DataGridView control Pin
Rahul Singla7-Feb-07 22:43
Rahul Singla7-Feb-07 22:43 
Questiondifference b/w shared ,public and public shared Pin
saravanaks7-Feb-07 22:16
saravanaks7-Feb-07 22:16 
AnswerRe: difference b/w shared ,public and public shared Pin
Christian Graus7-Feb-07 22:21
protectorChristian Graus7-Feb-07 22:21 
AnswerRe: difference b/w shared ,public and public shared Pin
Colin Angus Mackay7-Feb-07 22:21
Colin Angus Mackay7-Feb-07 22:21 
Questiondll hell problem Pin
saravanaks7-Feb-07 22:04
saravanaks7-Feb-07 22:04 
AnswerRe: dll hell problem Pin
Michael P Butler7-Feb-07 22:14
Michael P Butler7-Feb-07 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.