+ Reply to Thread
Results 1 to 3 of 3

Excel 2010 save-as issue...

Hybrid View

  1. #1
    sconly
    Guest

    Question Excel 2010 save-as issue...

    Can anyone tell me why the following code would prevent excel 2010 from doing a 'file->save as'?

    Private Sub AddEvents()
        'If xlApp Is Nothing Then SetApp
        Dim Cmd As Shape
        
        On Error Resume Next
        
        For Each Cmd In xlBook.Sheets("CES").Shapes
            ' Do a check so if it fails On Error send to the else statement
            Cmd.OnAction = "CESAddin.xlAppEvents." & Cmd.Name & "_Click"
            If Cmd.OnAction = "" Then
                Cmd.OnAction = "CESAddin.xlAppEvents.UnknownCMD_Click(""" & Cmd.Name & """)"
            End If
        Next Cmd
        On Error GoTo 0
        SetApp
    End Sub
    The code was written ny someone else not me.

    Thanks

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2010 save-as issue...

    Don't have an On error resume next in code that you haven't finished checking, otherwise you won't receive error messages that may help.

    I can't see any SaveAs in the code
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    sconly
    Guest

    Re: Excel 2010 save-as issue...

    Turns out it wasn't anything to do with that code.

    It something to do with one line of code and I don't understand why...

    Cancel = True

    If i comment that line out it work, uncomment it it doesn't work.

    Why would that little line of code prevent 'sav as'?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1