• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel 2010 Macro Enabled File Opens Slowly

Nu2Java

Member
Hello, I have a macro-enabled file here that for some reason is opening very very slowly and I do not know why. I don't really have a lot going on with this, I am importing two text files when prompted that contain a small amount of data, removing the files afterwards, ejecting a usb drive. This all happens to update a chart. With how little there is going on, I just cannot figure out why it is taking so long to open, and by that I mean 30-60 seconds. I have used it now for over a year and it didn't start out this way. Any help would be great!
 

Attachments

  • Update Chart Data - Copy.xlsm
    705.3 KB · Views: 3
Well... you have 1289 named ranges...
Some with #REF error.

I haven't looked too deep in your code, but you should add some routine to remove unnecessary named ranges. Most of them overlap, and I assume these are added by code somewhere.

Same goes for your workbook connections. There's 1293 connections present in the workbook.

EDIT: Tested by removing all named ranges and connections from the workbook. Took about second or two to open the file.
 
Last edited:
Well... you have 1289 named ranges...
Some with #REF error.

I haven't looked too deep in your code, but you should add some routine to remove unnecessary named ranges. Most of them overlap, and I assume these are added by code somewhere.

Same goes for your workbook connections. There's 1293 connections present in the workbook.

EDIT: Tested by removing all named ranges and connections from the workbook. Took about second or two to open the file.


@Chihiro can you tell me a little more about that? 1293 connections? And what all named ranges? Thanks EDIT: I figured it out, I never knew I was saving all of those. I will lookup a VBA way of removing those after each use. Thanks again, this works awesome now.
 
Last edited:
In your file, go to Formulas tab and click on "Name Manager".
upload_2017-11-7_15-19-46.png

For connections, go to Data tab, and check Connections.

upload_2017-11-7_15-20-37.png

I assume you add connection and named range somewhere in your code.
 
Back
Top