ExportAsFixedFormat on Mac

sh1ne

New Member
Joined
Jul 3, 2017
Messages
33
Office Version
  1. 2016
Platform
  1. Windows
Hi guys,

Got some problems with ExportAsFixedFormat in VBA on Mac, more precisely with the parameter "FileName" which is defining our filepath. I want to decide where I will save file and which name of file will be. Usually I don't get error but when I'm trying to swap "FilePathName" in FileName parameter with some variables or string I get error: Print error then
Run-Timer '1004':
Application-defined or object-defined error

There's code.

Code:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FilePathName, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
        :=False, OpenAfterPublish:=True

The result of that is file in location:
/Users/user/Library/Containers/com.microsoft.Excel/Data
with same name of Excel workbook.

All what I want is to put into FileName parameter some variables like "Folder string" & "File name" etc.


Tried some things such as putting strings, swapping PathSeparators from colons to slash, tried to find solutions, although it feels like I've dug the whole Internet (MrExcel is my last resort).

Before other questions: yes, I tried Ron De Bruin walk-around. Still without happy end. Using immediate window gives me correct answers, however it's not working when I want to use it as value of parameter.

Any ideas guys?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,897
Messages
6,175,269
Members
452,628
Latest member
dd2

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