reneemettrie
Terugkerende gebruiker
- Lid geworden
- 1 aug 2006
- Berichten
- 1.240
Ik heb voor een opleiding een macro die een tijdelijk bestand maakt in de map van ThisWorkbook.
En het daarna verwijdert met het Kill commando
Normaal werkt dit. Maar het verwijderen gaat blijkbaar niet als alles op OneDrive gebeurt. Heb geen ervaring met OneDrive, is dit normaal?
Fout 53: bestand niet gevonden
Sub CreateFile()
'Run this macro before running the next one
Dim WB As Workbook
Set WB = Workbooks.Add()
With WB
.SaveAs Filename:=ThisWorkbook.Path & "\Temporary", addtomru:=True
.Close
End With
'Check wether the file exists
End Sub
Sub ThisGoesWrong()
'Try this twice
Debug.Print ThisWorkbook.Path
Kill ThisWorkbook.Path & "\Temporary.xlsx"
'Further code
End Sub
Sub NeglectingError()
'Try this
On Error Resume Next
Kill ThisWorkbook.Path & "\Temporary.xlsx"
En het daarna verwijdert met het Kill commando
Normaal werkt dit. Maar het verwijderen gaat blijkbaar niet als alles op OneDrive gebeurt. Heb geen ervaring met OneDrive, is dit normaal?
Fout 53: bestand niet gevonden
Sub CreateFile()
'Run this macro before running the next one
Dim WB As Workbook
Set WB = Workbooks.Add()
With WB
.SaveAs Filename:=ThisWorkbook.Path & "\Temporary", addtomru:=True
.Close
End With
'Check wether the file exists
End Sub
Sub ThisGoesWrong()
'Try this twice
Debug.Print ThisWorkbook.Path
Kill ThisWorkbook.Path & "\Temporary.xlsx"
'Further code
End Sub
Sub NeglectingError()
'Try this
On Error Resume Next
Kill ThisWorkbook.Path & "\Temporary.xlsx"