Thread
:
ms excel template memory increase
View Single Post
#
2
Posted to microsoft.public.excel.programming
ms excel template memory increase[_2_]
external usenet poster
Posts: 1
ms excel template memory increase
"JLGWhiz" wrote:
You might try setting myObject to Nothing at the end of the second macro.
It could be stacking.
"ms excel template memory increase" <ms excel template memory
wrote in message
...
Hello, i programing
VB
6.0 and I have one MS Excel Application.
Public Sub S1()
Dim xTemplate As Object
.
.
.
Set xTemplate = CreateObject("Excel.Application")
For i=0 To N
S2(strFile)
Next i
.
.
.
If Not xTemplate Is Nothing Then
xTemplate.Quit
Set xTemplate = Nothing
End If
End Sub
Public Sub S2(strFile)
.
.
.
On Error GoTo 2
Set mObject = GetObject(, "Excel.Application")
If False Then
2: err.Clear
Set mObject = CreateObject("Excel.Application")
End If
On Error GoTo 0
Set mObject = mObject.Workbooks.Open(strFile)
.
.
.
With xSheet.Application
.Workbooks.Open(sPath)
.WorkSheets(1).Activate
.DisplayAlerts = False
.ActiveWorkbook.Worksheets(1).Delete
.ActiveWorkbook.Save
.DisplayAlerts = True
.ActiveWorkbook.Close
End With
.
.
.
End Sub
Memori increased every i in for cycle.
Help meeeeeeeeeeeeeeeeeeeeeeeeee................:((((
I use existing Excel Application and every time not create Application, this
is very slow.
I'm sorry but I hav'nt myObject object?
Reply With Quote
ms excel template memory increase[_2_]
View Public Profile
Find all posts by ms excel template memory increase[_2_]