P
P
paganeya2022-02-05 21:22:35
Visual Basic
paganeya, 2022-02-05 21:22:35

How to deal with this VBA element?

In general, you need to copy the directory, and specifically the open file
in visual basic there is such an element as ThisWorkbook.Path which defines the directory of the open file, or to be more precise, the whole path,
but I don’t know how to convert it into the copy paste command

.

Dim SourceFile, DestinationFile
iPath= ThisWorkbook.Path
SourceFile = "iPath" 
DestinationFile = "DESTFILE"  
FileCopy SourceFile, DestinationFile

Here is the code but it doesn't work for me. maybe it can be done via cmd like c:\ copy %papkadownloads% c:\ final . but I don’t know, I couldn’t find auto-access to the download folder, because the username folder will be on the way there, if it can somehow be replaced with something automatic, it would be cool. I can't figure out this problem

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question