1

Need suggestions here as I am creating a folder using MkDir and the folder name is an input in a cell from the user. After creating this folder I further need to create sub folder. strOrderNo stores the input value from the user.

Following is the code used and though the order no folder is created, not able to create sub folder invoices.

On Error Resume Next

MkDir "C\" & strOrderNo

MkDir "C\strOrderNo\Invoices"

On Error GoTo 0
1
  • 1
    Note that because of On Error Resume Next you don't see your error messages (it turns off all error messages). Because you don't see them, you don't know which the error message is, and that is why you cannot fix the error. Commented Feb 25, 2021 at 14:59

1 Answer 1

0

Your are using the strOrderNo in a mkdir string, rather than the variable.

Assuming the first mkdir is behaving how you want it, the second needs to be:

MkDir "C" & strOrderNo & "\Invoices"
Sign up to request clarification or add additional context in comments.

2 Comments

Shouldn't it be "C:\" & strOrderNo ?
only if it was meant to be that with the first mkdir as well. hence my 'assuming' disclaimer :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.