Macro doesn't work on Mac

Ilfalco87

New Member
Joined
Dec 19, 2016
Messages
7
I would need following macro to work on Mac. Importing images from a folders works perfectly on Windows, but I can't get it work on mac. I would like it to be possible to choose the folder. Thanks in advance!

Code:
Sub InsertPictures()

Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
Dim a As Integer
Dim xColIndex As Integer
Dim xRowIndex As Integer


On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = 40
xRowIndex = 14


a = 1




If IsArray(PicList) Then
    For lLoop = LBound(PicList) To UBound(PicList)
        
        Set Rng = Range(Worksheets("Report").Cells(xRowIndex, xColIndex), Worksheets("Report").Cells(xRowIndex + 9, xColIndex + 17))
        Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, Rng.Width, Rng.Height)
        
        If a Mod 2 = 0 Then
            xColIndex = xColIndex - 18
            xRowIndex = xRowIndex + 15
            If a Mod 6 = 0 Then
                xRowIndex = 14
                xColIndex = xColIndex + 38
            End If
        Else
            xColIndex = xColIndex + 18
        End If
               
        a = a + 1
    Next
End If
End Sub
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Unfortunately, it seems that Microsoft has made it very difficult to develop using VBA on Mac.
I have Office 365 installed on a MacBook and also running in Windows 10 (using Parallels 12 virtual machine) on the MacBook.
The VBE Editor on Mac is inferior to that in Windows and I guess that it would even be difficult for an experienced VBA developer to create that code.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

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