AW: Excel 2016 für Mac ist...
03.04.2017 14:37:35
Andre
Hallo Case
ich habe jetzt von der Sie die du mir geschickt hast folgendes Makro probiert.
Sub SaveActiveSheetAsPDFIn2016()
'Ron de Bruin : 10-March-2017
'Test macro to save the activesheet(or printarea) as pdf with ExportAsFixedFormat
'Note: This macro use the custom CreateFolderinMacOffice2016 function
Dim FileName As String
Dim FolderName As String
Dim Folderstring As String
Dim FilePathName As String
'Set the Orientation of the sheet, seems to default to xlPortait
'if we not use this code line. This is a bug in Mac Excel 2016
ActiveSheet.PageSetup.Orientation = ActiveSheet.PageSetup.Orientation
'Name of the pdf file
FileName = ActiveSheet.Name & " " & Format(Now, "dd-mmm-yyyy hh-mm-ss") & ".pdf"
'Make folder in the Office folder if it not exists and create the path/file name
FolderName = "PDFSaveFolder"
Folderstring = CreateFolderinMacOffice2016(NameFolder:=FolderName)
FilePathName = Folderstring & Application.PathSeparator & FileName
'ExportAsFixedFormat is not working correct in Mac Excel 2016, for example:
'expression A variable that represents a Workbook, Sheet, Chart, or Range object
'is not working if you change ActiveWorkbook, it always save the activesheet.
'Also the parameters are not working like in Win Excel.
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
FilePathName, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False
MsgBox "You find the PDF file in this location : " & FilePathName
End Sub
und wenn ich dieses jetzt teste kommt schon folgender Fehler
Fehler beim Kompilieren.:
"Sub" oder "Function" ist nicht definiert. und die erste Zeile wird direkt gelb eingefärbt.
Kannst du mir vielleicht einen Tip geben was ich alles löschen muss, denn es sind ja auch noch englische Anweisungen oder Erklärungen drin. Oder werden diese nicht beachtet?
Danke Gruß Andre