SOLVED

VBA to insert data in an excel file located in sharepoint

%3CLINGO-SUB%20id%3D%22lingo-sub-1479774%22%20slang%3D%22en-US%22%3EVBA%20to%20insert%20data%20in%20an%20excel%20file%20located%20in%20sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1479774%22%20slang%3D%22en-US%22%3E%3CP%3EI%20mean...%20Is%20this%20possible%3F%3C%2FP%3E%3CP%3EIf%20we%20can%20import%20using%20Query...%20Can%20we%20sort%20of%20export%2C%20or%20insert%20if%20you%20prefer%2C%20data%20(from%20a%20form%20for%20example)%20to%20a%20file%20located%20in%20the%20cloud%20(more%20specifically%20SharePoint)%20using%20VBA%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20would%20be%20pretty%20cool%2C%20wouldn't%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1479774%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20for%20web%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494235%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20to%20insert%20data%20in%20an%20excel%20file%20located%20in%20sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494235%22%20slang%3D%22en-US%22%3ESo%2C%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1493444%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20to%20insert%20data%20in%20an%20excel%20file%20located%20in%20sharepoint%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1493444%22%20slang%3D%22en-US%22%3EHi%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20please%20brief%20exactly%20what%20are%20you%20trying%20achieve%20to%20guide%20you%20the%20correct%20solution%3CBR%20%2F%3E%3CBR%20%2F%3ERegards%2C%20Faraz%20Shaikh%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted
Hi

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

Regards, Faraz Shaikh
Highlighted
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.
Highlighted

@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?    

Highlighted

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

Highlighted
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.
Highlighted
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.

Highlighted
Best Response confirmed by mgouveia (Occasional Contributor)
Solution

@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. 

Highlighted

@mtarler 

 

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.