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
There's code.
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?
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?