Long time reader first time poster. I've been using VBA for 6+ years now. I have a problem with a process that is largely exposed with a certain section of code. I have attached a link to the file for reference.
The file:- Contains 100 embedded images and minimal text
The code:- loops through and reformats 100 ranges of cells
On my old laptop(I5,8Gb Ram,Win7 and Office 2013) - This macro runs in 0.68 seconds on average
On my new XPS(I7,16Gb Ram, Win10 and Office 2013) - This macro runs in 20 seconds on average
I have tested on a few different computers running different windows/office and the results are between the two above.
Now here is the interesting part. I created a new file, copied over the images and formatted everything the same and then it ran at 0.5seconds(on the XPS). When I ran it a second time it was then up at 20 seconds. I duplicated the sheet in the same file and one sheet runs at 0.5 seconds and the other runs at 20 seconds. If I delete the images in the slow sheet then the speed is back down at 0.5 seconds also so the images are the culprit but I need them for the way this sheet(and others) are formatted rather than using conventional headers.
This code is part of a larger section of code in a very large and highly used spreadsheet and so this 20 seconds is amplified significantly in reality.
Can anyone replicate these results with the linked sheet on their computer, and if so can anyone tell me what is different between the sheets so that I can finally solve the problem?
The file:- Contains 100 embedded images and minimal text
The code:- loops through and reformats 100 ranges of cells
On my old laptop(I5,8Gb Ram,Win7 and Office 2013) - This macro runs in 0.68 seconds on average
On my new XPS(I7,16Gb Ram, Win10 and Office 2013) - This macro runs in 20 seconds on average
I have tested on a few different computers running different windows/office and the results are between the two above.
Now here is the interesting part. I created a new file, copied over the images and formatted everything the same and then it ran at 0.5seconds(on the XPS). When I ran it a second time it was then up at 20 seconds. I duplicated the sheet in the same file and one sheet runs at 0.5 seconds and the other runs at 20 seconds. If I delete the images in the slow sheet then the speed is back down at 0.5 seconds also so the images are the culprit but I need them for the way this sheet(and others) are formatted rather than using conventional headers.
This code is part of a larger section of code in a very large and highly used spreadsheet and so this 20 seconds is amplified significantly in reality.
Can anyone replicate these results with the linked sheet on their computer, and if so can anyone tell me what is different between the sheets so that I can finally solve the problem?
Book1.xlsm
drive.google.com