VBA to save document as pdf in a desktop folder on a MAC

Hermac

New Member
Joined
Sep 5, 2016
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hello,
I wrote this code on a computer with Windows 10 where it worked perfectly.
I 'd like to have it working on a Mac , but it fails on the red lines.
Can anybody help? Thank you very much in advance.
Herman

Sub BoekFactuur()
Dim Msg As String, FilNam As String, Last As Range
Set Last = Sheets("FacList").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
With Sheets("Factuur")
Last = .[E7]
Last.Offset(0, 1) = .[E4]
Last.Offset(0, 2) = .[E6]
Last.Offset(0, 3) = .[B4]
Last.Offset(0, 4) = .[E23]
Last.Offset(0, 5) = .[E24]
Last.Offset(0, 6) = .[E25]
Last.Offset(0, 7) = .[E26]
Last.Offset(0, 8) = .[E27]
Last.Offset(0, 9) = .[E28]
Last.Offset(0, 10) = .[E29]
Last.Resize(1, 3).NumberFormat = "0"
Last.Offset(0, 1).NumberFormat = "dd/mm/yy;@"
Last.Offset(0, 4).Resize(1, 7).NumberFormat = "#,##0.00"
End With
Sheets("Factuur").Activate
FilNam = "C:\Users\Herman\Desktop\VerkoopFacturen" & "F" & [E7] & "K" & [E6]
[B1:F30].ExportAsFixedFormat Type:=xlTypePDF, Filename:=FilNam & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False



End Sub
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,216,018
Messages
6,128,305
Members
449,439
Latest member
laurenwydo

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