P
Paul
I might have an issue re: memory leak within a looping macro in Visio and it
may be in the refreshing part of the macro. Each time, the macro ran, the
memusage increases and gets larger after each loop until the memory runs out.
I need to have this run continously by getting the data and then saving the
Visio Pages into html(s). Please find below the macro:
Public Sub saveAsWebPage()
Dim saveAsWeb As VisSaveAsWeb
Dim webSettings As IVisWebPageSettings
Dim vsoDataRecordset As Visio.DataRecordset
Dim intCount As Integer
Dim pg As Visio.Page
Set saveAsWeb = New VisSaveAsWeb
Set webSettings = saveAsWeb.WebPageSettings
Set webSettings = saveAsWeb.WebPageSettings
Set g_vsoApplication = Application
intCount = ThisDocument.DataRecordsets.Count
Set vsoDataRecordset = ThisDocument.DataRecordsets(intCount)
vsoDataRecordset.Refresh
webSettings.startPage = 1
webSettings.EndPage = ThisDocument.Pages.Count - 1
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Test.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 1
webSettings.EndPage = 1
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\True.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 2
webSettings.EndPage = 2
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\False.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 3
webSettings.EndPage = 3
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Right.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 4
webSettings.EndPage = 4
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Wrong.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
Loop
End Sub
Any suggestion would be greatly appreciated!! ANy ideas for a fix?
Thanks in advance!
may be in the refreshing part of the macro. Each time, the macro ran, the
memusage increases and gets larger after each loop until the memory runs out.
I need to have this run continously by getting the data and then saving the
Visio Pages into html(s). Please find below the macro:
Public Sub saveAsWebPage()
Dim saveAsWeb As VisSaveAsWeb
Dim webSettings As IVisWebPageSettings
Dim vsoDataRecordset As Visio.DataRecordset
Dim intCount As Integer
Dim pg As Visio.Page
Set saveAsWeb = New VisSaveAsWeb
Set webSettings = saveAsWeb.WebPageSettings
Set webSettings = saveAsWeb.WebPageSettings
Set g_vsoApplication = Application
intCount = ThisDocument.DataRecordsets.Count
Set vsoDataRecordset = ThisDocument.DataRecordsets(intCount)
vsoDataRecordset.Refresh
webSettings.startPage = 1
webSettings.EndPage = ThisDocument.Pages.Count - 1
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Test.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 1
webSettings.EndPage = 1
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\True.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 2
webSettings.EndPage = 2
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\False.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 3
webSettings.EndPage = 3
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Right.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
webSettings.startPage = 4
webSettings.EndPage = 4
webSettings.LongFileNames = True
webSettings.TargetPath = "s:\Wrong.htm"
webSettings.QuietMode = True
saveAsWeb.CreatePages
Loop
End Sub
Any suggestion would be greatly appreciated!! ANy ideas for a fix?
Thanks in advance!