VBA to insert data in an excel file located in sharepoint

Occasional Contributor

I mean... Is this possible?

If we can import using Query... Can we sort of export, or insert if you prefer, data (from a form for example) to a file located in the cloud (more specifically SharePoint) using VBA?


That would be pretty cool, wouldn't it?

8 Replies

Can you please brief exactly what are you trying achieve to guide you the correct solution

Regards, Faraz Shaikh
I know that is possible to insert information from one workbook to another using macro. I also know that is possible to GET information to your desktop excel file using an excel file located in SharePoint, using power query.

So I kinda wonder if there is any macro or technic that allow you to insert information from a workbook located in your PC to a workbook located in SharePoint (using the SharePoint link to the file I imagine).

I don't know exactly how to describe it, but you can ask again if I wasn't clear.

A more simple way to describe it is a workbook that has a form that sents information to a table in the cloud.

@mgouveia  I think I have a similar project going on and still learning how to deal with VBA to manipulate Sharepoint in the cloud.  If I have a drive mapped to the Sharepoint site I can do all the things I want but if not, I have problems with creating folders and files and such.  That said, if you are looking at creating/using a form to add data to a sheet on Sharepoint, have you looked at Microsoft Forms?    

Hi @mgouveia 


Are your trying to create SharePoint List from your desktop file to SharePoint ?


I would recommend you keeping the file on the SharePoint which is much safe & you can even manage the version history of your file without losing the data. 


Regards, Faraz Shaikh | MCT, MIE, MOS Master, Excel Expert

If you find the above solution resolved your query don't forget mark as Official Answer to help the other members find it more

Not exactly. I'm trying to insert and update rows in a table in a workbook located in a SharePoint site (and it's not located in my pc), thru an excel table which has a form in it.
Yes! I guess you understood what I'm looking for.

What do you mean by "drive mapped"?

I really like Microsoft Forms and it's a really good alternative to that, but... It's very very limited when compared to the tools I might be able to build in excel.

I'm trying to build an 'all in one' excel table, which would have forms and data analysis build in to save time and avoid switching programs.

best response confirmed by mgouveia (Occasional Contributor)

@mgouveia  it is possible to map a network drive to a sharepoint folder but you have to use internet explorer to make that site a trusted site.  it isn't a great way to do things if you have multiple people accessing the sheet, which is likely if you need to have the sheet in sharepoint in the first place.

  There is also powerapps which I'm trying to learn and work with to see if I can use that to do something using that tool, but will watch this topic to see if someone else chimes in with more info. 



I guess PowerApps might be the best workaround unfortunately (I mean, I already use excel and having to start using a completely new tool is a little challenging), but we will see if anybody has a better solution...


Thankyou @mtarler and @Faraz Shaikh for your time.