Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default ActiveWorkbook.Close (False)

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default ActiveWorkbook.Close (False)

Hi Dave,
First a correction.
Although the code worked under win XP Excel 2003 last night, it no longer
works and errors when the said line is in and does not error when the line is
not in.

Next. I never thought about taking that bit of code and run it in a different
workbook. Which i did with your recommendation.
This worked. No error and the workbook closed.
I'm lost...not that that wouldnt be easy anyway.
So i guess the error, although it happens or not with that specified line,
must come from something else.
How can i go about getting this fixed?
If i could i'd love to post my workbook if that would help you (someone) to
figure this out.

Thank you for your suggestion.

Stefan


Dave Peterson wrote:
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?

Hi,
Excel - shut down.

[quoted text clipped - 36 lines]
ActiveWorkbook.Close (False) '<= problem child
End Sub




--
Message posted via http://www.officekb.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default ActiveWorkbook.Close (False)

My guess is since the code worked in a new workbook, it's not the code.

I think the problem may be in the workbook itself. I think I'd try recreating
that workbook.

"stefan via OfficeKB.com" wrote:

Hi Dave,
First a correction.
Although the code worked under win XP Excel 2003 last night, it no longer
works and errors when the said line is in and does not error when the line is
not in.

Next. I never thought about taking that bit of code and run it in a different
workbook. Which i did with your recommendation.
This worked. No error and the workbook closed.
I'm lost...not that that wouldnt be easy anyway.
So i guess the error, although it happens or not with that specified line,
must come from something else.
How can i go about getting this fixed?
If i could i'd love to post my workbook if that would help you (someone) to
figure this out.

Thank you for your suggestion.

Stefan

Dave Peterson wrote:
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?

Hi,
Excel - shut down.

[quoted text clipped - 36 lines]
ActiveWorkbook.Close (False) '<= problem child
End Sub



--
Message posted via http://www.officekb.com


--

Dave Peterson
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
Auto Excel workbook close: save= false during an auto subroutine tomwashere2 Excel Programming 10 June 16th 05 06:23 AM
error on ActiveWorkbook.Close lesviago Excel Programming 1 February 2nd 05 11:11 PM
ActiveWorkbook.Close dallas Excel Programming 0 November 3rd 04 06:27 PM
ActiveWorkbook.Close dallas Excel Programming 2 November 3rd 04 05:56 PM
ActiveWorkbook.Close Matthew[_9_] Excel Programming 4 November 13th 03 02:48 AM


All times are GMT +1. The time now is 03:48 AM.

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"