marcel31281
Gebruiker
- Lid geworden
- 30 okt 2015
- Berichten
- 391
Beste forumleden,
Vanuit een userforum print ik een onderhoudsrapport in PDF formaat met onderstaande code.
Echter als ik dit op (gedeelde) onedrive wil opslaan krijg ik een foutmelding, heeft iemand een idee waar het probleem zit en hoe we dit wellicht kunnen oplossen.
Alvast bedankt,
Vanuit een userforum print ik een onderhoudsrapport in PDF formaat met onderstaande code.
Echter als ik dit op (gedeelde) onedrive wil opslaan krijg ik een foutmelding, heeft iemand een idee waar het probleem zit en hoe we dit wellicht kunnen oplossen.
Alvast bedankt,
Code:
'****************************************************************************************************************
'*********MAP VAN DE DAG AANMAKEN bestaande uit datum en SO nr. van vandaag (textbox13 en textbox24)*************
If TextBox13 <> "" And TextBox25 <> "" Then
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FolderExists(ThisWorkbook.Path & "\" & TextBox13.Value & "---" & TextBox25.Value & "") Then
MsgBox ComboBox2.Value & "," & vbCrLf & vbCrLf & _
"Er wordt nu een map aangemaakt met datum en SO-nummer van vandaag." & vbCrLf & vbCrLf & _
"Alle rapporten die je vandaag maakt worden hierin opgeslagen." _
, vbOKOnly + vbInformation
MkDir ThisWorkbook.Path & "\" & TextBox13.Value & "---" & TextBox25.Value & ""
End If
Else
MsgBox "er is geen datum of SO nr. ingevuld"
Exit Sub
End If
'***********EINDE CODE MAP AANMAKEN******************************************************************************
'****************************************************************************************************************
'****************************************************************************************************************
'**********BESTAND OPSLAAN IN DE VANDAAG AANGEMAAKTE MAP*********************************************************
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FileExists(ThisWorkbook.Path & "\" & TextBox13.Value & "---" & TextBox25.Value & "\" & TextBox1.Value & "---" & TextBox2.Value & ".pdf") Then 'controle of bestand al bestaat
Sheets("RAPPORT VPH").Range("A1:K61").ExportAsFixedFormat _
Type:=xlTypePDF, _
[COLOR="#FF0000"]Filename:=ThisWorkbook.Path & "\" & TextBox13.Value & "---" & TextBox25.Value & "\" & TextBox1.Value & "---" & TextBox2.Value & ".pdf", _[/COLOR]
OpenAfterPublish:=True 'False