2003 created Workbook casuses error when macro runs in 2007

C

Corey ....

I have a EXIT Clip Art image on the sheet that runs a macro to Save and
Close the workbook.
However i recently upgraded to Office 2007, but now allt he macros/forms run
fine, but the below code causes an error with excel when it runs, why and
what is the solution?

Sub Picture1_Click()
Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.DisplayAlerts = True
End Sub


I also use this code in the WB:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Navigation").Select
On Error Resume Next
Dim WB As Workbook
For Each WB In Application.Workbooks
Debug.Print WB.Name
If WB.Name <> ThisWorkbook.Name Then
If WB.Windows(1).Visible = True Then Exit Sub
End If
Next
Application.Quit
End Sub


Corey....
 
C

Corey ....

I have just noticed, that the code posted works OK when it is run from a
Forms Button on a sheet, but NOT when using a Clip Art picture with the
Macro attahced.
Is there a known issue with Pictures/Clip Art and Macros in 2007?


Corey....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top