Share via

Code issue

Scott Huang 3,511 Reputation points
2021-12-20T05:29:51.333+00:00

Hi,
I get permission denied, due to last line below. Why?

        txtfl10 = file_type & Right("0" & Month(Date), 2) & Right("0" _
            & Day(Date), 2) & Right("0" & Hour(Time()), 2) & Right("0" & Minute(Time()), 2) & _
            Right("0" & Second(Time()), 2) & "I.txt"
        Set wrtfl10 = flsys.createtextfile(txtfl10)
Microsoft 365 and Office | Excel | For business | Windows
Developer technologies | Visual Basic for Applications
0 comments No comments

Answer accepted by question author

Viorel 127K Reputation points
2021-12-20T12:46:34.147+00:00

Maybe the disk or folder is restricted, or the file already exists and is read-only or is already in use or restricted.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.