Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Code was working all the time, now sometimes it does and sometimes...

I have this little bit of code at the end of a sub to save the name of an
open Excel workbook:

oxlWks.Application.DisplayAlerts = False

oxlWks.Application.ActiveWorkbook.SaveAs filename:=fname,
FileFormat:=xlNormal

oxlWks.Application.DisplayAlerts = True

I have run this hundreds of times before without a problem, yet today it was
bombing out on me. I had made a small change to the sub, so I opened a
prior version without the change and still had the problem. I get a message
saying "The server threw an exception". This is happening more times than
not, but not always. The sub creates a workbook of the same name earlier in
the code, so when it works vs. when it does not work always involves saving
over an existing workbook of the same name.

I do seem to be having memory leaks, Excel will not shut down properly.
That may be related to the problem after it occurs, but it may be unrelated
to the cause, I really do not know. I went to the directory where all of
these workbooks were being saved, deleted them and then the system ran fine
again with no problems at all - I ran the same customer over and over so it
would be sure to overwrite the file and it did so easily. While this now
seems to work, I am concerned about a recurrence of this.

Any ideas about what could be causing this? Is it time to get incense and
sacrifice a chicken?


Reply
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
VB Code Is Not Working Rob Excel Discussion (Misc queries) 2 May 30th 07 05:23 PM
Various Random Codes not working from time to time Todd Huttenstine Excel Programming 0 May 21st 04 01:50 PM
why this code not working tj Excel Programming 0 September 2nd 03 07:14 PM
why this code not working Bernie Deitrick[_2_] Excel Programming 0 September 2nd 03 05:08 PM
For Each Code Not Working jacqui[_2_] Excel Programming 4 July 29th 03 02:44 AM


All times are GMT +1. The time now is 09:48 PM.

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

About Us

"It's about Microsoft Excel"