This is in a public Module
Public name, accessories, comments as string
Public edit As Object
Public xlApp As New excel.Application
Public xlWorkBook As excel.Workbook
Public xlWorkSheet As excel.Worksheet
Public Sub releaseObject(ByVal obj As Object)
Try
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj)
obj = Nothing
Catch ex As Exception
obj = Nothing
Finally
GC.Collect()
End Try
End Sub
End Module
and this is when the form is activated
xlWorkBook = xlApp.Workbooks.Open("C:\Users\DF\Desktop\exceltest.xls")
xlWorkSheet = xlWorkBook.Sheets("Sheet1")
xlApp.Visible = False
name = xlWorkSheet.Cells(Val(product), 2)
accessories = xlWorkSheet.Cells(Val(product), 5)
comments = xlWorkSheet.Cells(Val(product), 15)
nametxtbx.Text = name
accessoriestxtbx.Text = accessories
commentstxtbx.Text = comments
previewpicbx.Load("C:\Users\DF\Desktop\pictures\" + ((product).Trim) + ".jpg")
xlWorkBook.Close()
None of the textboxes show text and the preview picturebox does not work... Do I need any resources besides the excel object library 14.0 and the visual basic external applications 5.3?
By the way, product is a number in a textbox

New Topic/Question
Reply



MultiQuote









|