Questions tagged [vba]

Questions related to Visual Basic for Applications (VBA)

Filter by
Sorted by
Tagged with
0 votes
0 answers
173 views

Retrieving local path of a file hosted on SharePoint

I am actually at the end of my rope here, I'd really appreciate any insight however small. The scenario is as follows. My company hosts the majority of its data on SharePoint. For config management, ...
0 votes
0 answers
48 views

How to Update in Office 365 "SharePoint Online" List Item using VBA/Object XMLHTTP (See Code used below") No errors are received, Nothing Happens

Sub SPSyncSOAP() Set wsMHM = Sheets("MHM List") wsMHM.Activate Set rng = wsMHM.Range("A:A") LastRow = WorksheetFunction.CountA(rng) Dim ListName As String Dim SharepointUrl As ...
  • 1
0 votes
0 answers
197 views

How to get SharePoint document ID in vba with only filename (and path) available?

I am saving an Excel sheet as .pdf to a SharePoint document library and need to update the content type. I could update the content type via lists.asmx UpdateListItem method but I would need the file ...
  • 21
0 votes
0 answers
441 views

Open excel in a SharePoint with VBA in edit mode

I want to edit an Excel stored on a SharePoint but the file can't be modified. I use this code to open the distant file and edit: Private Sub test() Dim destFolder, fs, f Dim ptrFile Set ...
0 votes
0 answers
48 views

VBA code to open a file in sharepoint

i would like to know if it is still possible for a and excel file with macro to open a file saved in SharePoint. ever since we updated to the latest version of sharepoint i wasn't able to make the ...
0 votes
1 answer
184 views

Help with starting point for sharepoint online authenticator requests via VBA

I'm a user who maintains low-level VBA tools for myself and some colleagues. Some of the tools download or upload files from SharePoint online, treating the URLs as filepaths. I'm not familiar with ...
0 votes
1 answer
225 views

Using ADO in VBA to query a nested List table

My List contains a "Person or Group" field, and I have figured out that this is a nested table, with fields of its own. But I am having no luck (de)referencing it. My field is named ...
1 vote
1 answer
219 views

how can I upload a file to sharepoint using vba?

Update, I've learned that the SharedWorkSpace object has been deprecated. Anyone have another solution that doesn't use this object? I need to write a quick Excel VBA tool to send to our overseas ...
0 votes
0 answers
391 views

Unable to map SharePoint folder or access it via an Excel macro unless SharePoint is open in Internet Explorer

I posted a similar question on Stack Overflow a while ago, but didn't get any responses so far so thought I'd try here. Basically, I'm using an Excel macro to download a few files stored in a ...
  • 101
0 votes
2 answers
1k views

Return last modified date/time in VBA

Been really struggling to figure out how to return the last modified date/time in VBA, a lot of posts suggest using the already existing call to FileDateTime modifying the URL to look as follows: \\...
0 votes
0 answers
693 views

How to map Sharepoint 365 to network drive using VB script?

I am trying to map SharePoint Online 365 to network drive using VB script for my UFT test. Below is my test script. It used to work but the files need to be transferred to SharePoint online 365 and ...
  • 1
0 votes
1 answer
4k views

VBA Autheticate to SharePoint Office 365

I tried to follow the base instructions using this post (as it was the only one I could find) http://www.sharepoint-insight.com/2016/03/21/step-by-step-sharepoint-online-authentiaction-process-via-...
0 votes
0 answers
99 views

Save Email Attachment to Sharepoint

I receive an automated report with a big .csv file. Flow is timing out for sending the email to sharepoint. Does anyone know if I can use VBA to save certain email attachments to sharepoint? Thanks.
  • 131
0 votes
2 answers
1k views

VBA Excel Retrieve SharePoint User Number By Name (not User Information List)

Below, I've got a little job to insert a record into a SharePoint list. The Requestor field is a "Person or Group" type field, and in the code, the... rst![Project] = Sheets("Sheet2").Range("B2")....
0 votes
1 answer
474 views

How to access Enterprise Task Custom field in macro?

I need to use below function in my MS Project vba macro. Application.CustomFieldValueListAdd FieldID:=lookupfield, Value:=i It works fine for local field(field created locally in ms project in ...
  • 61
0 votes
1 answer
2k views

Sharepoint Document Library Hyperlink Metadata Using Excel VBA

I have VBA code written for my Excel document. This code saves the workbook in Sharepoint site and sets the metadata for the document library that the workbook is saved into. Working code to set ...
  • 1
1 vote
1 answer
5k views

SharePoint API and VBA - Access Denied

I'm trying to retrieve items from a SharePoint list using the SharePoint Web API. I'm coding in VBA, because a need to display the information in a Word document. However I'm getting the Access Denied ...
1 vote
0 answers
700 views

Understanding Access's automagic authentication to SharePoint Online

I'm trying to automate SharePoint tasks from Microsoft Access using the REST API (since the CSOM is not available in VBA). This, however, requires me to authenticate. I usually authenticate to ...
  • 111
1 vote
1 answer
60 views

Need timestamps for the completion of each stage in a work process flow

I'm using a MS SharePoint-based Intranet site to track and report the status of a requisition as it moves through its review processes. There are six stages in the process flow and, for performance ...
  • 11
1 vote
1 answer
3k views

SP Online REST API Change the Content Type of a Document Library Item

I would like to change the Content Type of items in a SharePoint On-Line Document Library, using VBA and the REST API. I would like to change existing Folders to a custom Content Type, derived from ...
1 vote
0 answers
40 views

Call VBA of Word template from .NET at server side using Sharepoint Server?

Can i call a VBA macro of a Word document, using .NET and Sharepoint Server? I mean, in a .NET client environment i can do this: oW = CreateObject("Word.Application") oW.Documents.Add("template.dotm")...
  • 11
0 votes
2 answers
1k views

SharePoint REST API - update metadata Document Library Item when value string includes apostrophe (single quote) character

I want to update a metadata column for an item (document set) in a SharePoint document library using REST API (via VBA). The below (vba) code extract/simplification works fine for simple cases, for ...
  • 1
0 votes
1 answer
5k views

Unable to upload to SharePoint Online via VBA

I have tried using the below code to upload a document to SharePoint Online (Sourced from this answer) Dim SharepointAddress As String Dim LocalAddress As String Dim objNet As Object Dim FS As Object ...
  • 127
1 vote
0 answers
5k views

Connect/Authenticate SPO with VBA (excel)

I am trying to connect to Sharepoint Online with Excel VBA script to create or delete items in a list. The problem is how to authenticate properly to SPO. I have checked the site with instruction: ...
  • 428
1 vote
0 answers
1k views

VBA: Get request on a SharePoint list

I'm trying to get elements of a Sharepoint list with VBA to show and use them in an Excel sheet. The normal get request on MSXML2.ServerXMLHTTP60 Dim xmlObj as Object Dim sUrl as String sUrl = "...
0 votes
2 answers
2k views

GetListItems Sharepoint Online

I'm currently trying to complete a table with information from the items of a Sharepoint Online list, using VBA code executed from Microsoft Word macro. I've successfully managed to achieve this when ...
  • 35
0 votes
1 answer
1k views

Getting version number into the spreadsheet

I have a spreadsheet on a spreadsheet located in a SharePoint library. Major and minor versions are enabled. I am trying to get names and values of some columns (metadata/properties) into the ...
  • 57
0 votes
1 answer
43 views

Document rolling back unexpectedly?

In my office we store an Excel document on SharePoint for everybody to enter data onto as the days and weeks go. I am tasked with reviewing this data and making sure it correct each month. We had some ...
  • 1
1 vote
1 answer
3k views

Syncing SharePoint metadata with Excel

I have a spreadsheet in a SharePoint Online library. The library has several columns of metadata, say A, B, C and D. The first two are text and next two are numbers. I would like to do two things: I ...
  • 57
1 vote
0 answers
1k views

Get the library name from GUID in VBA

I want to pull information from a SharePoint 2016 list in VBA. Below Code is what I found and that is working without depending on a view. Unfortunately the SQL query uses the list Name. A user could ...
1 vote
1 answer
3k views

Call SharePoint web service from excel macro vba

I have called SharePoint web service from excel macro VBA with following code from here: Sub CallService() Call Add_Item("List1", "https://contoso.sharepoint.com/sites/site1/", "test item", "...
  • 3,217
4 votes
2 answers
3k views

Error in update changes from Excel to SharePoint using macro vba

I have load the SharePoint online list in excel using following VBA code from here: Sub ImportListFromSP() Dim ws As Worksheet Set ws = ThisWorkbook.Worksheets(1) Dim src(1) As Variant ...
  • 3,217
1 vote
1 answer
906 views

vba script to add items to SharePoint online list

I have a vba script which captures the user input from the outlook and updates an excel sheet. I want the vba script to write into a sharepoint list in a SharePoint online site. Please let me know how ...
0 votes
1 answer
272 views

Create list items from uploaded excel spreadsheet

I am fairly new to doing anything in SharePoint, other than basic operations. I have been tasked with creating a SharePoint 2013 site with the following operations: Upload a selected Excel ...
0 votes
1 answer
108 views

Is it possible to have an user-interface and macros on sharepoint?

Context I'm making a project on a company that must have an user interface and a database or work directly over an excel. Also I need this on SharePoint. Info The problem is that in the company, ...
0 votes
2 answers
1k views

Excel VBA Moving SharePoint Folder

Due to SharePoint's 5000 item limit, I want to run an Excel VBA program to archive folders from a SharePoint "Active" Folder to another SharePoint Folder, called Completed. The only solution I can ...
1 vote
1 answer
181 views

How to limit the length of sharepoint multiline field through vb?

I want to limit the maximum number of characters in multi-line text field of a sharepoint list programmatically in VB. I found a field UnlimitedLengthInDocumentLibrary, by making this as true it ...
0 votes
1 answer
109 views

Use VBA to Relocate Folders from Old SharePoint Site to New Site

I'm currently tasked with relocation ~13,000 project folders from an old SharePoint site to our new site. Each folder will have contents, sub-folders, contents within those folders, etc. I'm sure ...
  • 1
0 votes
2 answers
229 views

Why is SharePoint not showing latest version of GIF?

Why is SharePoint not showing latest version of GIF? I'm using a VBA script in Excel to export and upload a diagram to SharePoint. This happens twice a day, which means I'm going to check for ...
  • 103
0 votes
1 answer
4k views

Excel VBA code to export chart as JPG and upload to sharepoint?

Currently I'm using the following code to export my diagram as JPG and save it in the worksheet directory. Sub exportDiagram_Click() Dim myChart As Chart Dim filePath As String Set ...
  • 103
0 votes
2 answers
9k views

Sharepoint properties update using Excel VBA

I am able to upload files to Sharepoint through VBA but I'm not able to update these properties to have their properties updated with 'Document Status' and 'Confidentiality' Fields. Until these are ...
1 vote
0 answers
184 views

Upload documents SharePoint : Problem updating metadata

I have written a code to copy files from a folder to SharePoint using FS.CopyFile LocalAddress, SharepointAddress But when I do it manually it asks me for Document status & Confidentiality I'...
1 vote
0 answers
47 views

Adding/updating column tags after populating a new document with bookmark values

Im currently running a project for a customer with the goal to automate a SharePoint environment along with word templates. So far i managed to create a word template which includes a Userform where ...
  • 51
1 vote
0 answers
113 views

Copy paste the value from one cell to another based on condition using VBA [closed]

Below are my steps that I need to perform in excel. and I wanted to automate this as & when I run Macro :) Background : I have already imported one sheet from another workbook and recorded the ...
  • 101
0 votes
1 answer
1k views

UpdateListItems Error: Data at the root level is invalid. Line 1, position 1

I´m trying the UpdateListItems web service but I always get following error in the response file: Data at the root level is invalid. Line 1, position 1. GetList, GetListItems and DeleteList works. ...
  • 1
0 votes
1 answer
91 views

Absolute beginner. Fell in the deep end

I have been tasked with maintaining and upgrading an infopath form that my predecessor created. I have absolutely 0 background on this particular form and he had no documentation as to where this form/...
1 vote
0 answers
1k views

Authentication error when trying to map SharePoint drive through VBA

In a 2010 Excel file I have a macro that downloads an Access database file from an external 2007 SharePoint site by mapping the SharePoint folder to an open drive. I've distributed the file to other ...
  • 143
0 votes
1 answer
425 views

Is there a way to get an Excel doc that uses a visual basic feature to show in SharePoint?

.com/GNU92.png First image shows the blue filled in date sections in the Excel doc. This is the desired display format of the doc. Second image shows what is displayed in SharePoint. No blue date ...
  • 1
2 votes
1 answer
10k views

Create sharepoint document folder using VBA

I need to find a way to programmatically, using Excel VBA, create a folder in a Sharepoint Document Library. The Sharepoint Document Library already exist, and it has already one level of folders in ...
  • 21
0 votes
1 answer
71 views

InfoPath Conditional Arguments

I am developing a form in InfoPath to publish to Sharepoint 2010 that will have to do some calculations based on inputs. I am trying to set the value of one field based on the input from 2 option ...
  • 3