Sweedler
Board Regular
- Joined
- Nov 13, 2020
- Messages
- 132
- Office Version
- 365
- Platform
- Windows
Hello
I am getting an error on my code, it is showing that something is wrong with the TEXT IN RED. The same code works fine on another document, so I am at a bit of a loss.
I am using the following code to export a PDF copy of my Sheet:
I am getting an error on my code, it is showing that something is wrong with the TEXT IN RED. The same code works fine on another document, so I am at a bit of a loss.
I am using the following code to export a PDF copy of my Sheet:
Rich (BB code):
Sub BATfaktura_generator()
Dim bolaget As String
Dim plats As String
Dim datum As String
Dim namn As String
Dim filename As Range
Dim saveLocation As String
bolaget = Sheet6.Range("K1")
plats = Sheet6.Range("K2")
datum = Sheet6.Range("K3")
namn = Sheet6.Range("A2")
Set filename = Sheet4.Range("A1")
saveLocation = "C:\Users\marcu\Desktop\EXCELLENT HELP - PC\Customers\Test folder\" & "Namn " & " - " & datum
Sheets("INDI SV").Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
filename:=saveLocation
End Sub
Last edited by a moderator: