|117095||Aug 11,2014 12:58 AM UTC||Aug 13,2014 05:50 AM UTC||Windows Forms||3|
Using this example I have run the code below but nothing appears in the form. I am missing something obvious.
The datatable definitely has rows and items and no errors appear. Pewrhaps I need to create some sort of object on the form
Sorry, I accidently posted this as a reply to an old issue
Private Sub frmMaster_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
If DSMaster.Tables.Count = 0 Then
' A new instance of the Excel Application is created
Dim excelEngine As New ExcelEngine()
Dim application As IApplication = excelEngine.Excel
application.DefaultVersion = ExcelVersion.Excel97to2003
' A new workbook object [bookOne] is created
Dim bookOne As IWorkbook = excelEngine.Excel.Workbooks.Create(1)
Dim sheet As IWorksheet = bookOne.Worksheets(0)
sheet.ImportDataTable(DSMaster.Tables("Master"), True, 1, 1, -1, -1) ', True)
Thank you for you help, however I do not think the problem is the datatable or the import statement. I have used the import statement many times to import to a worksheet then output the worksheet as an excel file.
The problem is that the code does not produce a visible worksheet. My guess is that there is no object for the form to display, so I see nothing on the form.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.