Click here to Skip to main content
15,921,959 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: .MAT files from Visual Basic (Again) Pin
Anonymous26-Aug-04 9:24
Anonymous26-Aug-04 9:24 
GeneralRe: .MAT files from Visual Basic (Again) Pin
Colin Angus Mackay25-Aug-04 23:03
Colin Angus Mackay25-Aug-04 23:03 
GeneralRe: .MAT files from Visual Basic (Again) Pin
murphypa26-Aug-04 3:47
murphypa26-Aug-04 3:47 
GeneralRe: .MAT files from Visual Basic (Again) Pin
Colin Angus Mackay26-Aug-04 12:15
Colin Angus Mackay26-Aug-04 12:15 
GeneralCreate XL sheet or CSV from vb.net Pin
partt25-Aug-04 9:49
partt25-Aug-04 9:49 
GeneralRe: Create XL sheet or CSV from vb.net Pin
Anonymous25-Aug-04 18:35
Anonymous25-Aug-04 18:35 
GeneralRe: Create XL sheet or CSV from vb.net Pin
partt26-Aug-04 3:28
partt26-Aug-04 3:28 
GeneralRe: Create XL sheet or CSV from vb.net Pin
Anonymous26-Aug-04 18:36
Anonymous26-Aug-04 18:36 
I can't test this with your data source of course on my end, and you'll have to de-bug it over there too, but it should give you an idea of how I would go about getting it to go.

You could call somthing like this on your return from GetClientView with your DataTable dt.

Private Function OpenWorkbook(ByVal dt As DataTable)
Dim oExcel As New Excel.Application
Dim oBook As Excel.Workbook
Dim oBooks As Excel.Workbooks
Dim oSheet As Excel.Worksheet
Dim oSheets As Excel.Sheets
Dim oCells As Excel.Range
Dim dr As DataRow
Dim ary() As Object
Dim iRow As Integer, iCol As Integer

'Start a new workbook in Excel.
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add
oBook = oBooks.Item(1)
oSheets = oBook.Worksheets
oSheet = CType(oSheets.Item(1), Excel.Worksheet)
oSheet.Name = "First Sheet"
oCells = oSheet.Cells
'Output Column Headers
For iCol = 0 To dt.Columns.Count - 1
oCells(2, iCol + 1) = dt.Columns(iCol).ToString
Next
'Output Data
For iRow = 0 To dt.Rows.Count - 1
dr = dt.Rows.Item(iRow)
ary = dr.ItemArray
For iCol = 0 To UBound(ary)
oCells(iRow + 3, iCol + 1) = ary(iCol).ToString
Next
Next
'Save the workbook and quit Excel.
oBook.SaveAs(Application.StartupPath & "Book1.xls")
oSheet = Nothing
oBook = Nothing
oExcel.Quit()
oExcel = Nothing
GC.Collect()
End Function

Note:
Don't forget to add the Com reference to Excel10 in your Solution Explorer.
GeneralRe: Create XL sheet or CSV from vb.net Pin
partt27-Aug-04 6:19
partt27-Aug-04 6:19 
GeneralPlaying .wav in VB .NET, with notification Pin
ckoverman25-Aug-04 8:40
ckoverman25-Aug-04 8:40 
GeneralRe: Playing .wav in VB .NET, with notification Pin
Anonymous25-Aug-04 16:27
Anonymous25-Aug-04 16:27 
GeneralRe: Playing .wav in VB .NET, with notification Pin
Aaron Eldreth26-Aug-04 13:25
Aaron Eldreth26-Aug-04 13:25 
QuestionBest method for pulling and displaying multiple count queries as an aspx page?? Pin
cavall25-Aug-04 6:57
cavall25-Aug-04 6:57 
AnswerRe: Best method for pulling and displaying multiple count queries as an aspx page?? Pin
Dave Kreskowiak25-Aug-04 8:01
mveDave Kreskowiak25-Aug-04 8:01 
GeneralUsing ActiveX in Visual Basic to connect to MATLAB Pin
murphypa25-Aug-04 4:50
murphypa25-Aug-04 4:50 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
Purple Monk25-Aug-04 5:19
Purple Monk25-Aug-04 5:19 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
murphypa25-Aug-04 6:04
murphypa25-Aug-04 6:04 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
Dave Kreskowiak25-Aug-04 7:45
mveDave Kreskowiak25-Aug-04 7:45 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
murphypa25-Aug-04 8:21
murphypa25-Aug-04 8:21 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
Anonymous25-Aug-04 6:36
Anonymous25-Aug-04 6:36 
GeneralRe: Using ActiveX in Visual Basic to connect to MATLAB Pin
Anonymous25-Aug-04 6:42
Anonymous25-Aug-04 6:42 
GeneralFlash player in a C# application Pin
Member 130484924-Aug-04 22:17
Member 130484924-Aug-04 22:17 
GeneralRe: Flash player in a C# application Pin
Dave Kreskowiak25-Aug-04 3:38
mveDave Kreskowiak25-Aug-04 3:38 
GeneralRe: Flash player in a C# application Pin
Dave Kreskowiak25-Aug-04 3:40
mveDave Kreskowiak25-Aug-04 3:40 
GeneralPrinting in 136 column wide mode Pin
Member 132035224-Aug-04 21:29
Member 132035224-Aug-04 21:29 

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.