View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default ActiveWorkbook.Close (False)

Look for something like: drwtsn32.log or drwatson.log

But once you find it, I bet it won't help.

If it fails on that line (which looks ok to me), maybe you can try the code in a
test workbook.

Could it be that there's somekind of corruption happening with that workbook?



"stefan via OfficeKB.com" wrote:

Hi,
Excel - shut down.
When i remove the line
ActiveWorkbook.Close True (or False)
from my code, i do not get the error. I can close the file manually and i can
close Excel manually.
With the line of code, the macro runs, saves the workbook, gives the
completion message box, and generates the Excel error. Shutting Excel down.
It states it creates an error log. I have no clue where to look for that log.

Strange thing is that i tested this under Win and Excel XP at home and it
worked like a charm.

Thank you for your help.

Stefan
----------------------
Sub Save_1_From_User_1()
'On Error Resume Next
Dim strdate As String
strdate = Format(Now, "dd-mmm-yy -- hh-mm-ss -- ")
Application.ScreenUpdating = False
' Mark to activate macro for user 2
Range("A1").Select
ActiveCell.FormulaR1C1 = "x"
' Copy/paste User Name formula to text only
Range("UserNameRange").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
' Save the service form to location 1
' ActiveWorkbook.SaveAs "serviceformcopy.xls" ' Test Location/name 1
ActiveWorkbook.SaveAs "L:\Consultant service\Returns\Service_Forms\" &
"ID " & Sheets("Service Form").Range("C9") _
& " -- " & strdate & " from " & UserName & ".xls"
Application.ScreenUpdating = True
' Completion message and close of workbook
MsgBox "Submitted Successfully. - Thank you.", vbInformation, "Submission
Notice"
ActiveWorkbook.Close (False) '<= problem child
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200507/1


--

Dave Peterson