View Single Post
  #4   Report Post  
Rowan Drummond
 
Posts: n/a
Default Closing File Error

Hi Jason

I don't have a solution but a couple of observations.

Firstly:
Private Sub CommandButton1_Click()
UserForm1.Hide
End Sub

This is hiding userform1 and not closing it so it may be that this
userform is still loaded when you try to close the file which could
cause problems. Try
Private Sub CommandButton1_Click()
Unload UserForm1
End Sub

Secondly:
Sub Today()
'
' Today Macro
' Macro recorded 9/21/2005 by Jason Cogle
'
' Keyboard Shortcut: Ctrl+Shift+T
'
ActiveCell.FormulaR1C1 = "=TODAY()"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End Sub

This macro has the same name as an inbuilt excel function which is not a
good idea. It is also not needed as it replicates the inbuilt excel
shortcut Ctrl+;.

Hope this helps
Rowan

jcliquidtension wrote:
Hi James:

Although the code isn't too complicated, there are quite a few functions.
I've included the code from my personal workbook first, since I have this
problem with more than one file while attempting to close. I also included
the code in one of the files that gives me an error when trying to close
(most of the time when not saving changes).

The following code is in my personal workbook (module 1) which I use
frequently on

<snip