I was advised to write an alias at the top of my form when Importing Excel due to a conflict I was having.
VB Code:
Imports Excel = Microsoft.Office.Interop.Excel
I cannot find the Interop bit. It only offers .Core
I've searched and cannot figure out what I'm doing wrong. How do I get that option? I've imported the Office and Excel COMs. I'm using Office 2003.
Q. 2. On a form load I create and excel workbook with 25 worksheets which works fine. Should this code however not completely close all Excel processes? When I look at task manager there is still an excel process. I created this on a new app with no other Excel references etc... I closed all excel processes from the task manager just to be sure and tried the code again. It creates the process and it stays there even after closing everything.
I'm having problems with a program and can't rule out that the excel process may be causing it. Don't see any reason why it should but just want to be sure so would like to know that it's completely gone from memory/whatever. (this code works fine btw).
VB Code:
Imports Excel Dim moApp As New Excel.Application moApp = DirectCast(CreateObject("Excel.Application"), Excel.Application) 'Create Excel Object moApp.Visible = False '--------------------------------------------------------------------------------------------- '-------DECLARE THE IMAGE AND VIDEO WORKBOOKS------------------------------------------------------------' Dim oVidWB As Excel.Workbook '= moApp.Workbooks.Open(Data_Output & file_Name & "\Vidworkbook1.xls") 'Open the workbook Dim osht1 As Excel.Worksheet oVidWB = moApp.Workbooks.Add For T As Integer = 24 To 0 Step -1 osht1 = oVidWB.Sheets.Add() osht1.Name = Cases(T).ToString osht1 = Nothing Next oVidWB.SaveAs(Data_Output & file_Name & filename(r)) oVidWB.Close(False) oVidWB = Nothing moApp.Quit() moApp = Nothing


Reply With Quote