Create a folder in One drive using Excel VBA

Chandrakanth Gajawada 1 Reputation point
2022-07-09T12:18:53.97+00:00

I am trying to create a folder in One Drive using Excel VBA but I am getting a run time error. Please help

Sub Script()

Folderpath = (Application.ActiveWorkbook.Path) & "/"
usrdt = Format(Date, "DDMMMYYYY") & "-" & Format(Now(), "HHmmss")
VBA.FileSystem.MkDir (Folderpath & usrdt)

End Sub

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,286 questions
{count} votes