You could call a cmd from vba to execute the format command e.g.
Dim cmd_str As String
cmd_str = "cmd.exe /C format f:"
Call Shell(cmd_str, vbNormalFocus)
obviously the example above is for drive f:, change this as needed.
Question
I want to format a drive from visual basic application. Can anybody help me with it ? I have tried shFormat(), but it is not completing my task. And If I Format my drive through CMD, it should be a background process for my application.
Solution
You could call a cmd from vba to execute the format command e.g.
Dim cmd_str As String
cmd_str = "cmd.exe /C format f:"
Call Shell(cmd_str, vbNormalFocus)
obviously the example above is for drive f:, change this as needed.