Hi,
I have written code in outlook to open excel & post email messages in excel.
I have a global var named xlApp to open excel. ( The code creates an instance of excel if excel is not running, else only adds a new workbook).. folowwing is the code :-
Function CreateDestinationWB() As Workbook
' This function returns a workbook object.
Dim xlWB As Workbook
On Error Resume Next
Set xlApp = GetObject(, "excel.application")
If Err.Number <> 0 Then
On Error GoTo ErrorHandler
Set xlApp = CreateObject("excel.application")
xlApp.Application.Visible = True
Err.Clear
End If
xlApp.SheetsInNewWorkbook = 3
Set CreateDestinationWB = xlApp.Workbooks.Add
end function
Display More
There are around 7 subs/functions where am using "Set xlSheet = WBName.Sheets(1)"
& at the end of each sub/function I set them to nothing. (WBName is the name of the work that I pass to each sub/function)
The problem is eveytime excel application is opened it takes too much memory (around 35k) .... Please can anyone let me what I could be doing wrong. Is referencing too many objects creating this issue (although I have made sure, i set them to nothing before the sub ends)... Any help is highly appreciated. Many Thanks in advance !