What is fast way to add 300 sheets with data to Excel? - excel

Currently I’m using Excel Application Scope which is unchecked AutoSave and unchecked Visible, and using Save Workbook as the first picture below.
Estimated execution time is 10 minutes.
Adding new sheet is slower as the sheets increase.

Use the Write Range activity instead. This will be 4-times faster.

Related

Workbook with Pivot Tables Opens Very Slowly

I am working with an Excel 2013 workbook on Windows 10. It has ten pivot tables and takes a long time (~2 mins) to open. I have tried a lot of things to speed this up to no avail. Here are the specs:
The workbook is about 40 Mbytes in size. It is an *.xlsm file with a significant VBA app that can be activated by clicking a button. However, there is no Workbook Open event and no worksheet level events.
All of the pivot tables are based on data from a single worksheet within the workbook. No external data.
All of the pivot tables are set to NOT refresh on open. They are also set to not save data. (I tried both ways and if anything setting it to save data caused it to take longer to open.)
The pivot tables contain no formulas. The data worksheet has no formulas. The workbook in its entirety has very few formulas. The app creates formulas to populate the sheets, but then converts all of the formulas to values.
The pivot tables did have conditional formats, but even after deleting them all, the workbook still takes about the same time to come up.
This is not the startup delay issue. There is a dialog telling me that the load is 0% … 20% … 40% … complete.
I deleted just the pivot table sheets from the workbook and the workbook comes up in just a few seconds.
I also created a new workbook by copying over all the sheets and code thinking there might be a low-level corruption issue, but the copy didn't come up any faster.
Do pivot tables just naturally come up slow? Is there any property or setting I can change to speed up the workbook opening process? A number of people use these workbooks and are very dissatisfied.
Right click inside pivot, Pivot Table options, Data tab, clear/uncheck the checkbox "Save source data with file."
Every time you create a Pivot, Excel stores a copy of the source data in the file and uses it to run queries. If you created 10 Pivots separately, you'll have 10 caches saved in the file making it bloated/slow. To optimize the file, you'll want to create a Pivot and then COPY that Pivot for ALL other Pivots that use the SAME data table. This will ensure you use only 1 cache instead of 10. Also, as a bonus, when you refresh one it'll refresh all of them.
**Only keep this unchecked if there's no external data.
Cheers

Providing a list of files in Excel of a directory is slowing down excel

I need to provide a current list of files in a directory in an Excel workbook and everything is working as required, just too slowly. I really only need the list to check it is current once upon opening the workbook. It takes around 11 seconds to do this which is acceptable but the problem is it keeps rechecking this every time I carry out even minor edits to the workbook (I guess due to the fact that it is brought in as an Excel table). I determined the lag in my workbook using the rangetimer() function that is provided and it is the only thing taking a long time to calculate. I should also state that the table containing the list of files is finally used in a cell on another worksheet to provide a data validation drop-down list but don't believe this is really the issue.
I did some Googling on reducing Excel calculation times and discovered that there are some Excel functions that are definitely culprits for increasing calculation times (described as volatile) and three of these (NOW,INDEX and ROW) are used in providing the functionality I would like in this part of the workbook.
I have tried two solutions so far:
1. Force Full Calculation set to True in VBA properties window
2. Switched calculations to manual. I set this back to automatic once I identified that this part of the workbook was the issue as I don't want manual calculation generally.
The formula I have in the 'refers to' box of the named range (TutorFileList) is:
'''=FILES("\O008DC01\Shared\Tutor Qualifications*")&T(NOW())'''
The formula I have in each cell of the excel table is:
'''=IFERROR(INDEX(TutorFileList,ROW()-1),"")'''
What I would like to have is the ~11secs of calculated time to find these files reduced down to just one check of the networked directory rather than it taking 11secs of automatic recalculation every time the workbook is modified.
If there is a more efficient way to achieve what I am doing I am prepared to redesign things but I do need the functionality of a drop-down list of files in the specific directory in a cell.
Many thanks for assistance from anyone on this.
I have resolved my issue by reducing the number of rows back to around 200 instead of 500 rows. This brings the calculation lag back to about a second which I can live with.

How to improve Excel performance in workbook with external links and conditional formatting

I have 5 workbooks with 540 column x 50 row blocks of data.
I also have a 'roll-up' workbook that lists all this data on a single worksheet with links. There are 6 conditional formatting rules.
The roll-up workbook takes ~30 seconds to update links on open and takes 1-2 seconds each time i modify data and move around the worksheet.
I feel like Excel should be able to work with this data in a performant manner.
Am I doing anything wrong? Should i have set things up differently?
I've tried using arrays of links and individualy linked cells and not noticed a difference.
-- EDIT --
When I remove the conditional formatting, the 30 second refresh takes 1 second. Additionally, some Data Validation dropdowns speed up from 6 seconds to immediate. I'll look at ways of removing the Conditional Formatting (like the VBA idea below).
I don't think the problem is in the conditional formatting but rather, it is in the fact that you need to open data from 5 different workbooks. Trying to consolidated those workbooks first would improve the speed. Refreshing data connections takes 30 sec.
Alternatively, instead of a linked cell, try to use designated data connections (as you would in Power Query, for example). This way a refresh wouldn't happen automatically but the responsiveness of the main spreadsheet would improve.
From experience, conditional formatting can really slow a spreadsheet down. I had one much smaller template that became unusable due a lot of conditional formatting, so I had to redesign it with VBA code instead. In that case this was workable as the cells didn't change much after the initial set-up, so the script only needs to be run once. It would not be so workable if the data is likely to change often.
You might consider putting the formatting in a VBA script, depending on how often the data (and hence the formating) is likely to change.

Calculate only the active workbook before saving

I have tried my level best to find an answer for this question and with no luck I am here posting my first question on stackoverflow.
Question: Can excel calculate only the active workbook before saving while other workbooks are open.
Scenario: I have a large workbook with multiple sheets of reports with formulas. The main control VBA creates multiple workbooks with multiple sheets of reports based on several variables. All report workbooks are converted to values on creation.
Problem: it takes around 20 seconds to calculate the main workbook. Thus when the VBA is trying to save and close the report workbook it calculates both the report and the main workbook which is creating performance issues.
Looking forward to your solutions.
Thanks in advance for your time.
Manoj.
There is no built-in method of only calculating the active workbook (see https://excel.uservoice.com/forums/304921-excel-for-windows-desktop-application/suggestions/10601079-workbook-level-calculation for my suggestion to the Excel team about this).
You can switch off calculation for individual worksheets using Worksheet.Enablecalculation and you can stop Excel from calculating on save by switching off Application.CalculateBeforeSave, but both of these have potentially undesirable side effects.

Wait time after change slicer in power pivot

I have a powerpivot table and one slicer with several values. I have a macro that loops over my slicer and makes a copy of the data and paste the values in another excel
After any data update when I change the slicer Excel takes some time to query or recalculate values and in the cells appear "#######" during some seconds until the the new data are loaded.
This is a problem for my macro because it is copying this characters instead of the values. I have try two approaches to give more time to the loading process:
Create a Wait of 5 seconds that is more than enough before copy-pasting the data
Put a Msgbox to stop the copy pasting.
None of them work. Both of them seems to interrupt the loading process that I though will run in the background.
Is there any event in vba that notifies me when the data are loaded?
For those who can't use CalculateUntilAsyncQueriesDone because it hangs indefinitely, I devised a solution for this. It's blunt but it works.
https://stackoverflow.com/a/40792389/1540567

Resources