简体   繁体   中英

VBA macro on excel to create a new folder on dropbox

I have a small module where I do some data entry into an excel database using a userform.

I want to add an element to it that when I click submit, a folder on my shared dropbox drive is created with the name of the company I added to my userform.

Note - the dropbox account is shared my 2 other users as well. The filepath would be:

C:\\Users[user]\\nc Dropbox\\investment oportunities\\1. Companies

Any help would be appreciated!

Cheers!

Code

Private Sub Inisubmit_Click()

If Startup_Name.Value = "" Then
MsgBox "Enter Startup Name", vbExclamation, "Input Data"
    Exit Sub
Else:

Dim LastRow As Long, ws As Worksheet

Set ws = Sheets("Summary")

LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row + 1 'Finds the last 
blank row

'Date input

 ws.Range("A" & LastRow).Value = Format(Date, "mm/dd/yyyy")

'Source Input

 If Events.Value = True Then
    ws.Range("B" & LastRow).Value = Events.Caption
ElseIf Referral.Value = True Then
    ws.Range("B" & LastRow).Value = Referral.Caption
ElseIf Direct.Value = True Then
    ws.Range("B" & LastRow).Value = Direct.Caption
ElseIf Search.Value = True Then
    ws.Range("B" & LastRow).Value = Search.Caption
End If

'Startup Info
ws.Range("AG" & LastRow).Value = sourcedetail.Value
ws.Range("AI" & LastRow).Value = Sector.Value
ws.Range("C" & LastRow).Value = Startup_Name.Value
ws.Range("H" & LastRow).Value = Startup_Location.Value
ws.Range("I" & LastRow).Value = Startup_Overview.Value
ws.Range("L" & LastRow).Value = funding_needed.Value
ws.Range("AD" & LastRow).Value = revenuebox.Value


'Round Check

 If seed.Value = True Then
    ws.Range("F" & LastRow).Value = seed.Caption
 ElseIf seriesa.Value = True Then
    ws.Range("F" & LastRow).Value = seriesa.Caption
 ElseIf seriesb.Value = True Then
    ws.Range("F" & LastRow).Value = seriesb.Caption
 ElseIf SeriesC.Value = True Then
    ws.Range("F" & LastRow).Value = SeriesC.Caption
 End If

End If

End Sub

How does one add a new folder in dropbox using VBA?

Thank you @rhyfewler !

The function works as follows: MkDir "c:\\TOTN\\Examples"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM