Click here to Skip to main content
15,903,362 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralPassing data from datagrid to Dataset Pin
Danny van der Walt18-Feb-04 9:17
Danny van der Walt18-Feb-04 9:17 
GeneralRe: Passing data from datagrid to Dataset Pin
John Kuhn18-Feb-04 20:23
John Kuhn18-Feb-04 20:23 
GeneralRe: Passing data from datagrid to Dataset Pin
Danny van der Walt19-Feb-04 19:55
Danny van der Walt19-Feb-04 19:55 
GeneralRe: Passing data from datagrid to Dataset Pin
John Kuhn22-Feb-04 8:07
John Kuhn22-Feb-04 8:07 
GeneralRe: Passing data from datagrid to Dataset Pin
Danny van der Walt22-Feb-04 23:57
Danny van der Walt22-Feb-04 23:57 
GeneralRe: Passing data from datagrid to Dataset Pin
John Kuhn23-Feb-04 13:49
John Kuhn23-Feb-04 13:49 
GeneralExcel in VB6 Pin
Wilbur J. Pereira18-Feb-04 7:41
Wilbur J. Pereira18-Feb-04 7:41 
GeneralRe: Excel in VB6 Pin
John Kuhn20-Feb-04 9:54
John Kuhn20-Feb-04 9:54 
The whole answer, in a nutshell, is to control Excel directly through VB. First, add a reference to the Excel Library through Project...References.

Then, you can do things like the following:


Private Sub cmdStart_Click()
    Dim xl As New Excel.Application
    Dim myWorkBook As Excel.Workbook
    Dim myWorkSheet As Excel.Worksheet
    xl.Workbooks.Open "c:\000\Book1.xls"
    Set myWorkBook = xl.ActiveWorkbook
    Set myWorkSheet = myWorkBook.ActiveSheet
    With myWorkSheet.Range("Headers")
        With .Borders.Item(xlEdgeBottom)
            .Weight = XlBorderWeight.xlThin
            .LineStyle = XlLineStyle.xlContinuous
        End With
        .Font.Italic = True
    End With
    Dim intRow As Integer
    Dim intTop As Integer
    intTop = 3
    For intRow = 1 To myWorkSheet.Range("Data").Rows.Count
        Dim intRowOffset As Integer
        intRowOffset = intRow + intTop
        myWorkSheet.Cells(intRowOffset, 2).Font.Bold = True
        myWorkSheet.Cells(intRowOffset, 2).Value = 5
    Next
    myWorkBook.Save
    myWorkBook.Close
End Sub



What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
GeneralRe: Excel in VB6 Pin
John Kuhn23-Feb-04 16:36
John Kuhn23-Feb-04 16:36 
GeneralArray display Pin
Isaiah2518-Feb-04 4:26
Isaiah2518-Feb-04 4:26 
GeneralRe: Array display Pin
Yogendra Agarwal19-Feb-04 9:12
Yogendra Agarwal19-Feb-04 9:12 
Generalnull delimited string Pin
r i s h a b h s17-Feb-04 23:47
r i s h a b h s17-Feb-04 23:47 
GeneralRe: null delimited string Pin
steff kamush18-Feb-04 5:35
steff kamush18-Feb-04 5:35 
GeneralRe: null delimited string Pin
r i s h a b h s18-Feb-04 16:45
r i s h a b h s18-Feb-04 16:45 
GeneralRe: null delimited string Pin
steff kamush19-Feb-04 4:32
steff kamush19-Feb-04 4:32 
GeneralRe: null delimited string Pin
r i s h a b h s19-Feb-04 17:58
r i s h a b h s19-Feb-04 17:58 
GeneralGet domains & workgroups-reply plzzzz Pin
radhika8117-Feb-04 19:11
radhika8117-Feb-04 19:11 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
John Kuhn17-Feb-04 19:25
John Kuhn17-Feb-04 19:25 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
radhika8117-Feb-04 19:55
radhika8117-Feb-04 19:55 
GeneralRe: Get domains & workgroups-reply plzzzz Pin
John Kuhn17-Feb-04 20:04
John Kuhn17-Feb-04 20:04 
Generalvbscript compiler error Pin
alan.net17-Feb-04 17:01
alan.net17-Feb-04 17:01 
GeneralRe: vbscript compiler error Pin
John Kuhn17-Feb-04 19:55
John Kuhn17-Feb-04 19:55 
Questionicons of task manager?? Pin
fordge17-Feb-04 15:16
fordge17-Feb-04 15:16 
QuestionWhat is ADO.NET? Pin
bensoncd17-Feb-04 12:46
bensoncd17-Feb-04 12:46 
AnswerRe: What is ADO.NET? Pin
John Kuhn17-Feb-04 15:50
John Kuhn17-Feb-04 15:50 

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.