Click here to Skip to main content
15,915,864 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Groupbox problem [modified] Pin
Rekless3-Jan-10 14:00
Rekless3-Jan-10 14:00 
Questionworking with Crystal Report with VB 6 Pin
jayachandra.c6-Feb-09 2:14
jayachandra.c6-Feb-09 2:14 
Questionfile recovery Pin
cst_kvp6-Feb-09 1:52
cst_kvp6-Feb-09 1:52 
AnswerRe: file recovery Pin
EliottA6-Feb-09 2:45
EliottA6-Feb-09 2:45 
GeneralRe: file recovery Pin
Luc Pattyn6-Feb-09 9:30
sitebuilderLuc Pattyn6-Feb-09 9:30 
AnswerRe: file recovery Pin
Dave Kreskowiak6-Feb-09 3:43
mveDave Kreskowiak6-Feb-09 3:43 
AnswerRe: file recovery Pin
0x3c06-Feb-09 8:17
0x3c06-Feb-09 8:17 
QuestionDataGridView selection back color problem Pin
Jay Royall5-Feb-09 23:44
Jay Royall5-Feb-09 23:44 
GeneralGenerating codes for fingerprint security door using VB.Net Pin
awoyale5-Feb-09 22:21
awoyale5-Feb-09 22:21 
GeneralRe: Generating codes for fingerprint security door using VB.Net Pin
Smithers-Jones6-Feb-09 0:24
Smithers-Jones6-Feb-09 0:24 
QuestionCombo Box Frustration Pin
shoorrock5-Feb-09 18:43
shoorrock5-Feb-09 18:43 
AnswerRe: Combo Box Frustration Pin
Christian Graus5-Feb-09 22:06
protectorChristian Graus5-Feb-09 22:06 
Question[Message Deleted] Pin
woca4u5-Feb-09 11:56
woca4u5-Feb-09 11:56 
AnswerRe: textbox Control problem Pin
Christian Graus5-Feb-09 12:51
protectorChristian Graus5-Feb-09 12:51 
GeneralRe: textbox Control problem Pin
woca4u5-Feb-09 13:14
woca4u5-Feb-09 13:14 
GeneralRe: textbox Control problem Pin
Johan Hakkesteegt5-Feb-09 20:33
Johan Hakkesteegt5-Feb-09 20:33 
GeneralRe: textbox Control problem Pin
woca4u5-Feb-09 20:54
woca4u5-Feb-09 20:54 
GeneralRe: textbox Control problem Pin
Johan Hakkesteegt5-Feb-09 22:10
Johan Hakkesteegt5-Feb-09 22:10 
GeneralRe: textbox Control problem Pin
Christian Graus5-Feb-09 22:15
protectorChristian Graus5-Feb-09 22:15 
AnswerRe: textbox Control problem Pin
Bharat Jain5-Feb-09 23:26
Bharat Jain5-Feb-09 23:26 
QuestionExport problem to Excel Pin
ivo755-Feb-09 10:25
ivo755-Feb-09 10:25 
This is code

Dim xlApp As New Excel.Application()
xlApp.Visible = True
xlApp.UserControl = True
Dim xlWorkBook As Object = xlApp.Workbooks
Dim oldCI As System.Globalization.CultureInfo = _
System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture = _
New System.Globalization.CultureInfo("en-US")
xlApp.Workbooks.Add()
System.Threading.Thread.CurrentThread.CurrentCulture = oldCI


xlApp.Visible = True
xlApp.UserControl = True

Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
Dim i As Integer
Dim j As Integer

xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add
xlWorkSheet = xlWorkBook.Sheets("sheet1")

For i = 0 To RabotniciDataGridView.RowCount - 2
For j = 0 To RabotniciDataGridView.ColumnCount - 1
xlWorkSheet.Cells(i + 1, j + 1) = _
RabotniciDataGridView(j, i).Value.ToString()
Next
Next

xlWorkSheet.SaveAs("C:\vbexcel.xls")
xlWorkBook.Close()
xlApp.Quit()

releaseObject(xlApp)
releaseObject(xlWorkBook)
releaseObject(xlWorkSheet)

MsgBox("You can find the file C:\vbexcel.xls")

but when I try export to Excel give me this errror "Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))"

Have some ideas?
AnswerRe: Export problem to Excel Pin
EliottA5-Feb-09 10:40
EliottA5-Feb-09 10:40 
GeneralRe: Export problem to Excel Pin
ivo755-Feb-09 10:59
ivo755-Feb-09 10:59 
GeneralRe: Export problem to Excel Pin
EliottA5-Feb-09 11:02
EliottA5-Feb-09 11:02 
GeneralRe: Export problem to Excel Pin
ivo755-Feb-09 11:10
ivo755-Feb-09 11:10 

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.