VBA Sharepoint file

Cozzy123

New Member
Joined
Aug 10, 2016
Messages
14
Hi all,

I've gone through some of the recent posts but I'm still struggling.

I have a userform that captures text from textbox's, I would like to use a command button to then upload the text in the textbox's into an excel file on Sharepoint. The file on sharepoint is the master copy, so it would have to then filed the next free row, cells etc. I can make it work when its on a Network Drive, but I can't get it to work on Sharepoint, any help very welcome.

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I think I'm almost there, apologies for my pigeon VBA.

I have setup Sharepoint so when I open a file it will always open in desktop app, here is my code:


ActiveWorkbook.FollowHyperlink Address:=Url (This is my sharepoint address that I've set)

MsgBox "Uploading your data"

Workbooks("sheet1").Activate

Application.Wait (Now + TimeValue("00:00:05"))

NextRow = _
ActiveWorkbook.Application.WorksheetFunction.CountA(Range("A:A")) + 1
Cells(NextRow, 1) = TextBox72
Cells(NextRow, 2) = ComboBox2
Cells(NextRow, 3) = TextBox73
Cells(NextRow, 4) = TextBox74
Cells(NextRow, 5) = ComboBox109
Cells(NextRow, 6) = ComboBox111
Cells(NextRow, 7) = TextBox75
Cells(NextRow, 8) = TextBox77
Cells(NextRow, 9) = TextBox76
Cells(NextRow, 10) = TextBox78
Cells(NextRow, 11) = TextBox82
Cells(NextRow, 12) = TextBox79
Cells(NextRow, 13) = TextBox80
Cells(NextRow, 14) = ComboBox114
Cells(NextRow, 15) = ComboBox87
Cells(NextRow, 16) = ComboBox113
Cells(NextRow, 17) = TextBox81
Cells(NextRow, 18) = ComboBox112
Cells(NextRow, 19) = ComboBox110

Workbooks("sheet1").Close

MsgBox "Your data was uploaded successfully, thank you."

When I run this code, it opens the excel sheet but it gives me a run time error 9, but when I F5 and refresh it works?

Any thoughts?

Cheers
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,852
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top