Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8237609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:31:32+00:00 2026-06-07T19:31:32+00:00

I have sales global sales data in very large files which I need to

  • 0

I have sales global sales data in very large files which I need to filter by country and product and then analyze. Since I will need to perform this same analysis over and over again with different country/product combinations I am trying to do this with a macro.

This is what the macro does:

  1. Open the source files with global data;
  2. Filters the data;
  3. Copies it and pastes it into a workbook which houses the macro;
  4. Recalculates and refreshes the workbook and;
  5. Saves a copy of the file to another folder.

The macro appears to run fine and the files are being saved, however I am running into 2 problems on steps 4 and 5:

  • The pivot tables do not seem to be refreshing – this may be because the second problem:
  • All pivot tables in the saved copy still refer to the original file

I’d prefer to fix both problems by generating the copied file without links, but I’m also open to any bandaids that might allow me to force the copied file to link to itself (this doesn’t seem to work when I do it manually).

I have the full code if you want to see it all, but because I suspect the issue is in how I’m saving the file I’ll just paste that piece here. Let me know if you need to see another part of the macro. Any help would be much appreciated, thanks in advance.

Save Function:

Public Sub SaveAsCopy(filePath As String)
   Dim updateStatus As Boolean

   'Check current status of Alerts
   updateStatus = Application.DisplayAlerts
   'Turn off alerts
   Application.DisplayAlerts = False

   ThisWorkbook.Sheets.Copy 'creates new workbook without macros"
   'The New workbook copy is now the Active workbook
   'Delete Control Sheet
   ActiveWorkbook.Sheets(1).Delete

   'Save Macro free version and close
   ActiveWorkbook.SaveAs Filename:=filePath, FileFormat:=51
   ActiveWorkbook.Close

   'Revert back to origional alert status
   Application.DisplayAlerts = updateStatus

End Sub

Function Call:

Call SaveAsCopy(filePath)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:31:34+00:00Added an answer on June 7, 2026 at 7:31 pm

    Will share the workaround I developed since I didn’t get any bites on a more elegant solution:

    Public Sub SaveAsCopy(filePath As String)
       Dim updateStatus As Boolean
    
       'Check current status of Alerts
       updateStatus = Application.DisplayAlerts
       'Turn off alerts
       Application.DisplayAlerts = False
    
       'Hide Control Sheet
       ActiveWorkbook.Sheets(1).Visible = False
    
       'Save Macro free version and close
       ActiveWorkbook.SaveAs Filename:=filePath, FileFormat:=52
    
       'Unhide
       ActiveWorkbook.Sheets(1).Visible = True
    
       'Revert back to original alert status
       Application.DisplayAlerts = updateStatus
    
    End Sub
    

    At the end of the parent function I close the current file, reopen the original, and loop through the new workbooks to remove macros.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As far as I understand Magento have various order statuses under global/sales/order/statuses which can
a conceptual question: I have a global system which sales agents use to write
I need a little help brainstorming on a query. I have a sales table
I have sales statistic data in array form to calc standard deviation or average
I have a global javascript function which .appends() a tooltip element to any element
Possible Duplicate: Reading and Writing Configuration Files Okay, I have a config file, which
I have sales data from some our online listings. I randomly priced the same
lets say i have 2 tables: products (just product ID and name) and sales
I have created a custom Magento module which extends the core sales order functionality
I have established an array and a large textbox which displays the array. Basically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.