We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
smarta1
5 years agoExplorer | Level 3
load files whit excel vba
Hi.
I would like to receive an example on how to upload a file (ie *.xlsm) to dropbox from excel using vba.
Thanks a lot.
smarta1
Explorer | Level 3
Hi Jay.
Thanks for your answer.
I am using MS Excel (Microsoft Office) on a Desktop with Windows 8.1 (No Office Online).
I would like to have a VBA routine to insert in my excel file (*.xlsm).
Best regards.
Jay
5 years agoDropbox Staff
I'm not sure if it's possible to create a VBA script to upload to Dropbox directly, however, you can look into the Dropbox API documentation for more information to see if there is any possibility of doing so using the info there.
- smarta15 years agoExplorer | Level 3
Hi Jay.
I asked because I found the following but I do not know if is complete:
Public Sub DB_PutFile(FileName As String)
Dim req As MSXML2.ServerXMLHTTP60
Dim strFile As String
Dim Pos1 As Integer
Dim Pos2 As Integer
Dim arg As String
Set req = New MSXML2.ServerXMLHTTP60
strFile= ReadBinary(FileName)
arg = "{""path"":""/" & FileName & """,""mode"":{"".tag"":""overwrite""},""autorename"":false,""mute"":true}"
req.Open "POST", "https://content.dropboxapi.com/2/files/upload", False
req.setRequestHeader "Authorization", "Bearer xxxxxxxxxxxxxxxx"
req.setRequestHeader "Content-Type", "application/octet-stream"
req.setRequestHeader "Content-length", Len(Result)
req.setRequestHeader "Dropbox-API-Arg", arg
req.setRequestHeader "User-Agent", "api-explorer-client"
req.send strFile
If req.Status = 200 Then
Debug.Print req.responseText
Else
'MsgBox req.Status & ": " & req.statusText
Debug.Print req.responseText
End If
End Sub
Can you help me?
Best regards.
- Jay5 years agoDropbox Staff
It does look like some API calls are made there. I can move this thread to the API forum, however, bear in mind that we might not be able to assist with the VBA script as it isn't related to Dropbox itself.
- Greg-DB5 years agoDropbox Staff
smarta1 The Dropbox API does offer the ability to programmatically upload files, such as by using /2/files/upload as referenced in the code you shared. Please refer to the documentation linked there for information on using that.
Give that a try and if something on the API isn't working expected, please share the error/output.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!