Hi, We use SharePoint as a document management system and I would like to make a spread sheet template that will take data out of SharePoint and enter it into cells in the xlsx document. We use this at the moment
Sub SynchServerProperties()
Dim metaprop As MetaProperty
On Error Resume Next
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, _
AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
For Each metaprop In ActiveWorkbook.ContentTypeProperties
If metaprop.Name = "Document Type" Then
Cells(Document_Type).Value = metaprop.Value
End If
If metaprop.Name = "Reference" Then
Cells(1, 18).Value = metaprop.Value
End If
If metaprop.Name = "Revision" Then
Cells(2, 18).Value = metaprop.Value
End If
If metaprop.Name = "Date of Application" Then
Cells(3, 18).Value = metaprop.Value
End If.....................
This enters the data into specific cells, eg, it puts the reference number into row 1, column 18
but this can change if anyone adds extra columns into the sheet.
Is there a way for the data to be entered into a Cell Name?
Many thanks for any help
Gavin.
Sub SynchServerProperties()
Dim metaprop As MetaProperty
On Error Resume Next
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, _
AllowFormattingCells:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowInsertingColumns:=True, AllowInsertingRows:=True, AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
For Each metaprop In ActiveWorkbook.ContentTypeProperties
If metaprop.Name = "Document Type" Then
Cells(Document_Type).Value = metaprop.Value
End If
If metaprop.Name = "Reference" Then
Cells(1, 18).Value = metaprop.Value
End If
If metaprop.Name = "Revision" Then
Cells(2, 18).Value = metaprop.Value
End If
If metaprop.Name = "Date of Application" Then
Cells(3, 18).Value = metaprop.Value
End If.....................
This enters the data into specific cells, eg, it puts the reference number into row 1, column 18
but this can change if anyone adds extra columns into the sheet.
Is there a way for the data to be entered into a Cell Name?
Many thanks for any help
Gavin.