PDA

View Full Version : Help With Mac VBA script SaveAs



kennyquinten
06-02-2015, 01:33 PM
Hello, i am trying to make auto save sheet but I always get an error for the following line.
Can anyone tell me what is wrong here?

'ActiveWorkbook.SaveAs NieuwFact, FileFormat:=52


Sub VolgFact()
Range("B13").Value = Range("B13").Value + 1
Range("A24:D29").ClearContents
Range("F24:F29").ClearContents
Range("H24:I29").ClearContents
Range("O24:O29").ClearContents
Range("I21:I21").ClearContents
Range("B12").Value = Date
End Sub


Public Sub OpslBestand()
Dim NieuwFact As Variant
'kopiëren document als nieuwe factuur
ActiveSheet.Copy
NieuwFact = "Macintosh HD:Gebruikers:kennyquintens:Documenten:Facturen:VerkoopFacturen 2015:Factuur_" & Range("B13").Value & ".xlsx"
ActiveWorkbook.SaveAs NieuwFact, FileFormat:=52
ActiveWorkbook.Close
VolgFact
End Sub


Friendly regards,
Kenny.