Geht das VBA und Apple?
16.02.2022 12:27:20
Vasko
ich habe hier schon super Unterstützung bekommen und mir mit dieser Hilfe ein Arbeitsblatt erstellt, das mir eine echte Hilfe ist.
Jetzt habe ich versucht dieses Arbeitsblatt auf einem Apple-Rechner auszuführen und festgestellt das manche Makros nicht funktionieren.
Im meinem Beispiel Makros, die auf die Ordnerstruktur des Rechners zugreifen und Daten auslesen.
Und da wäre meine Frage: Gibt es die Möglichkeit, die Befehle an Apple anzupassen, oder irgendeine Art von Kompatibilitätsmodus?
Hier die beiden Makros, die auf Windows ohne Probleme funktionieren und bei Apple nicht mehr😥.
Sub Hochformatbilder_einfügen()
'Update 20140513
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim sShape As Shape
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
xRowIndex = Application.ActiveCell.Row
For lLoop = LBound(PicList) To UBound(PicList)
Set Rng = Cells(xRowIndex, xColIndex)
Set sShape = ActiveSheet.Shapes.AddPicture(PicList(lLoop), msoFalse, msoCTrue, Rng.Left, Rng.Top, 117, 156)
xRowIndex = xRowIndex + 1
Next
End If
End Sub
Sub nurDateiennameninmarkierteZelle()
Dim PicList() As Variant
Dim PicFormat As String
Dim Rng As Range
Dim xFolder As Object
Dim xColIndex As Long, xRowIndex As Long
Dim lstrFilenameOnly() As String
On Error Resume Next
PicList = Application.GetOpenFilename(PicFormat, MultiSelect:=True)
xColIndex = Application.ActiveCell.Column
If IsArray(PicList) Then
xRowIndex = Application.ActiveCell.Row
For lLoop = LBound(PicList) To UBound(PicList)
Set Rng = Cells(xRowIndex, xColIndex)
lstrFilenameOnly = Split(PicList(lLoop), "\")
Rng.Value = lstrFilenameOnly(UBound(lstrFilenameOnly))
xRowIndex = xRowIndex + 1
Next
End If
End Sub
Wenn es eine Antwort darauf gibt, dann hier😊!Ganz herzlichen Dank und liebe Grüße
Vasko