ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,832
- Office Version
- 2007
- Platform
- Windows
Hi,
My code has saved a pdf file in a specified folder.
The code then activates another worksheet in the same workbook.
Some operations are now done.
A userform now opens & i require when i click the OK button to kill / delete the file that was saved as mentioned above.
This is the userform code.
When i click OK on the userform i check in the folder & the file in questioned hasnt been killed / deleted.
Do you see an issue with this code please
My code has saved a pdf file in a specified folder.
The code then activates another worksheet in the same workbook.
Some operations are now done.
A userform now opens & i require when i click the OK button to kill / delete the file that was saved as mentioned above.
This is the userform code.
When i click OK on the userform i check in the folder & the file in questioned hasnt been killed / deleted.
Do you see an issue with this code please
Rich (BB code):
Private Sub CloseForm_Click()
Dim MyFile As String
Unload ValueInInvoiceCell
MyFile = "C:\Users\Ian\Desktop\REMOTES ETC\DR\DR SCREEN SHOT PDF\" & Range("G13").Value & ".pdf"
If Dir(MyFile) <> "" Then Kill MyFile 'SAVED INVOICE HAS NOW BEEN DELETED
End Sub