does inefficient code slow down file open ?

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
294
I have got everything in place, it all works albeit sometimes slowly, I know I have inefficiencies in the VBA, but would this slow down the length of time it takes to open the file, or am I just impatient ? as for timing it takes about 15 seconds, I have several pieces of code across 4 modules and a user form, so pasting it would take a huge chunk, though certainly able if it is required
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Things that can really slow down file opening include masses of formulas and especially external links to other Excel files. Do you have any of these?

Do you have automaic calculation turned on?

What is the nature of the code that is being executed that you think is inefficient ie is it doing a lot of copying/pasting across sheets which include formulas that might be being forced to recalc?
 
Upvote 0
thanks Firefly2012,

it is an invoicing system, it has a customer selection and address vlookups, address / suburb / state / postcode, and a product selection section with 16 lines in it , with "if justified" data leading into product 4 lookups , a copy and paste of the whole sheet and auto renaming. after the renaming it, then resets all the formulas in case they have been over written with data and clears all cells which require new data to be written it also prints a copy as well as filling out a register and creating a pdf copy. it has been done piecemeal from askiong this site a lot of questions and modifying to suit. It will be inefficient, because I also used the macro recorder a fair bit.
 
Upvote 0
Is the code called when the wb opens?
 
Upvote 0
So the code is actually irrelevant as to why the workbook is opening slowly as it isn't even being executed as this point?

What is the size of the workbook?

Does it contain any external formula links?

Try changing calculation to manual and reopening to see if it makes any difference
 
Upvote 0
So the code is actually irrelevant as to why the workbook is opening slowly as it isn't even being executed as this point?
correct , I didn't know if the code were "pre-read" so space could be allocated.
What is the size of the workbook?
properties says 'Size 1.67KB , Size On Disk 4.00KB, but in the folders view it says 6.85MB
Does it contain any external formula links?
the vlookups read data only from within the workbook, there is an update macro, which copies data from an external crystal report, but only when activated by a button and a save routine which opens a write protected workbook, unprotects it , copies the worksheet , protects it and closes, but again on the click of a button
Try changing calculation to manual and reopening to see if it makes any difference
only about a second if that, I thought it opened quicker before I added the reset coding
 
Upvote 0

Forum statistics

Threads
1,216,551
Messages
6,131,310
Members
449,642
Latest member
jobon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top