VBA problems after upgrading to Excel 2016

vandango05

Board Regular
Joined
Oct 6, 2008
Messages
110
Hi.

I've got a worksheet with many macros that have worked fine in Excel 2010 that i've just stopped using buy many colleagues still are. Here is an example of some code that will no longer run.

Code:
Sub deleteimages()Dim s As String
Dim pic As Picture
Dim rng As Range


' Set ws = ActiveSheet
Set ws = ActiveWorkbook.Worksheets("Quotation")


Set rng = ws.Range("A26:L8000")


For Each pic In ActiveSheet.Pictures
With pic
s = .TopLeftCell.Address & ":" & .BottomRightCell.Address
End With
If Not Intersect(rng, ws.Range(s)) Is Nothing Then
pic.Delete
End If
Next


End Sub

It fails at the line
Code:
For Each pic In ActiveSheet.Pictures

another section of code i'm having problems with simply filters some data

Code:
ActiveSheet.Range("$K$5:$K$7475").AutoFilter Field:=1, Criteria1:=">0", _
        Operator:=xlAnd

It appears that 2016 doesn't much like the ActiveSheet part. No doubt i'm going to have lots more issues as more users adopt 2016 so any help would be appreciated.
 
I'm calling the Macro with a button, hoistnoteetc is just the name of another macro that runs at that stage of the code which appears to work fine.

In isolation it may do - is it perhaps changing the active sheet ?
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Do you have any add-ins?
If so try removing them & see if you still get the same problem
 
Upvote 0
Do you have any add-ins?
If so try removing them & see if you still get the same problem

No add-ons. I'm going to try removing all the macros and re-adding them one by one to find the actual issue I think.

Thanks for your suggestions thus far, hopefully i'll have a solution tomorrow - head has gone to mush for the day.
 
Upvote 0
Also worth checking the references in the VBE to see if any are marked as MISSING
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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