+ Reply to Thread
Results 1 to 2 of 2

Excel crashing when trying to save spreadsheet with macro

  1. #1
    Registered User
    Join Date
    07-01-2015
    Location
    London
    MS-Off Ver
    Oficce 2014
    Posts
    1

    Excel crashing when trying to save spreadsheet with macro

    Hello,

    I am trying to create an excel file that filters pivot table based on a list of names and then emails this view to the person. The macro works perfectly but when I try to save the spreadsheet it crashes, shuts down and does not recover. The code I have used is below (I've taken out the email bit ) and the list of names sits in the sheet called Filter.

    Sub RefreshPivot()

    LastBDM = Sheets("Filter").Range("B" & Rows.Count).End(xlUp).Row

    For Row = 3 To LastBDM

    Dim BDM As String
    Dim BDMEmail As String
    BDM = Sheets("Filter").Range("A" & Row).Value
    BDMEmail = Sheets("Filter").Range("B" & Row).Value


    Sheets("Filter").Range("B1").Value = BDM
    Sheets("RandM").Activate

    Sheets("RandM").PivotTables("RandM").PivotCache.Refresh

    ActiveWorkbook.Save

    Next Row

    End Sub

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel crashing when trying to save spreadsheet with macro

    Try moving the save command after your for next loop.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save As macro keeps crashing excel program
    By GmcdAU in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-12-2015, 10:57 PM
  2. Excel spreadsheet crashing on mac with this error.
    By Danoprimo in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 03-26-2013, 08:30 AM
  3. Macro to Copy Sheets and Save As New Workbook Crashing Excel
    By JamieAtJack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2012, 08:19 PM
  4. can I save if excel is currently crashing
    By dmalloy8 in forum Excel General
    Replies: 0
    Last Post: 08-22-2010, 09:13 PM
  5. Excel spreadsheet keeps crashing on save
    By Scotts Neil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2007, 07:44 AM

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