LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Excel creates massive files on calling vba workbook.save method

I have what seems an innocuous bit of VBA code.

Private Sub App_WorkbookBeforeSave(ByVal WB As Workbook, ByVal
SaveAsUI As Boolean, Cancel As Boolean)

.....
Dim wbName As String
wbName = WB.name
Set WB = Nothing
getLog().wDebug "re requesting WB with no modules(" & wbName & ")"
Set WB = Application.Workbooks(wbName)
getLog().wDebug "Saving Changes(" & WB.name & ")"
WB.Save
Cancel = True
getLog().wDebug "ENDING overloaded before save event for (" &
WB.name & ")"
ErrorHandler:

End Sub

This catches the event of saving a worksheet.

But on the '.save' method excel goes into a flat spin and creates a
massive temporary file that continues to grow until excel dies
horribly.
In my log file I see this

DEBUG-26/09/2007 14:33:36-thmedlan-re requesting WB with no
modules(CRexPortfolioBuilder.xls)
DEBUG-26/09/2007 14:33:36-thmedlan-Saving
Changes(CRexPortfolioBuilder.xls)

Which seems to suggest the '.save' method is to blame. I have taken
the stack trace of what excel was doing at the time. Does anyone have
any ideas as to what I am doing wrong? and why workbook.save behaves
so badly?

Thanks
Tom


ntoskrnl.exe+0x584d
ntoskrnl.exe!KeQueryRuntimeThread+0x5e8
hal.dll+0x2ef2
hal.dll!HalRequestSoftwareInterrupt+0x3c
ntoskrnl.exe!Kei386EoiHelper+0x237d
SYMEVENT.SYS!EventObjectCreate+0xa20
SYMEVENT.SYS!SYMEvent_AllocVMData+0x5de9
ntoskrnl.exe!Kei386EoiHelper+0x237d
ntoskrnl.exe!ZwSetSystemInformation+0x23
ntdll.dll!KiFastSystemCallRet
ole32.dll!CoWaitForMultipleHandles+0x15be1
ole32.dll!WriteClassStm+0x2eb3
ole32.dll!WriteClassStm+0x2fd5
ole32.dll!StgCreateDocfile+0x691
ole32.dll!StgOpenStorageOnHandle+0xcfb
ole32.dll!CoFreeAllLibraries+0x185b
ole32.dll!WriteClassStm+0x5096
ole32.dll!WriteClassStm+0x5380
ole32.dll!WriteClassStm+0x3b06
ole32.dll!WriteClassStm+0x39d6
ole32.dll!WriteClassStm+0x365f
ole32.dll!WriteClassStm+0x3852
ole32.dll!WriteClassStm+0x374e
VBE6.DLL!rtcShell+0x25cc8
VBE6.DLL!rtcShell+0x24f3c
VBE6.DLL!rtcShell+0x254cc
VBE6.DLL!rtcShell+0x27ff7
VBE6.DLL!rtcShell+0x27f9b

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel creates multiple temp files when saving westbrom Excel Discussion (Misc queries) 7 September 25th 13 04:09 PM
Excel creates temporary files Temporary files in Excel Excel Discussion (Misc queries) 1 May 13th 10 12:20 PM
workbook creates a backup evertime I save it. how to remove? Roger Excel Worksheet Functions 0 September 7th 07 09:56 PM
Is there a method by which we can programatically save the workbook? divya Excel Programming 4 July 12th 06 11:52 AM
Excel 2k3: Workbook on network drive, when save creates new file AVCCTech Excel Discussion (Misc queries) 1 July 7th 05 08:05 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"