excel vba工具sharepoint怎么用

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了excel vba工具sharepoint怎么用相关的知识,希望对你有一定的参考价值。

参考技术A Public Function Parse_Resource(URL As String)
'Uncomment the below line to test locally without calling the function & remove argument above
'Dim URL As String
Dim SplitURL() As String
Dim i As Integer
Dim WebDAVURI As String

'Check for a double forward slash in the resource path. This will indicate a URL
If Not InStr(1, URL, "//", vbBinaryCompare) = 0 Then

'Split the URL into an array so it can be analyzed & reused
SplitURL = Split(URL, "/", , vbBinaryCompare)

'URL has been found so prep the WebDAVURI string
WebDAVURI = "\\"

'Check if the URL is secure
If SplitURL(0) = "https:" Then
'The code iterates through the array excluding unneeded components of the URL
For i = 0 To UBound(SplitURL)
If Not SplitURL(i) = "" Then
Select Case i
Case 0
'Do nothing because we do not need the HTTPS element
Case 1
'Do nothing because this array slot is empty
Case 2
'This should be the root URL of the site. Add @ssl to the WebDAVURI
WebDAVURI = WebDAVURI & SplitURL(i) & "@ssl"
Case Else
'Append URI components and build string
WebDAVURI = WebDAVURI & "\" & SplitURL(i)
End Select
End If
Next i

Else
'URL is not secure
For i = 0 To UBound(SplitURL)

'The code iterates through the array excluding unneeded components of the URL
If Not SplitURL(i) = "" Then
Select Case i
Case 0
'Do nothing because we do not need the HTTPS element
Case 1
'Do nothing because this array slot is empty
Case 2
'This should be the root URL of the site. Does not require an additional slash
WebDAVURI = WebDAVURI & SplitURL(i)
Case Else
'Append URI components and build string
WebDAVURI = WebDAVURI & "\" & SplitURL(i)
End Select
End If
Next i
End If
'Set the Parse_Resource value to WebDAVURI
Parse_Resource = WebDAVURI
Else
'There was no double forward slash so return system path as is
Parse_Resource = URL
End If
End Function

excel VBA 组合框 取值

请教在excel中想将组合框中的值取出赋予变量如何编写代码?
如组合框名:下拉框1,变量名:序号

参考技术A 序号=下拉框1 参考技术B excel中的下拉框有三种,一个是excel窗体工具栏中的,一个是excel控件工具栏中的,还有一个是VBA界面中的。
这几个使用都不方便,所以我不使用它们,不如直接引用单元格方便,或者使用“数据-有效性”中的序列。

下面这个是excel VBA中的帮助文件,也许对你有用。
ListBox 控件、AddItem 和 RemoveItem 方法以及 ListIndex、ListCount 属性示例

下例用 AddItem、RemoveItem 以及 ListIndex 和 ListCount 属性来添加和删除列表框的内容。

若要使用该示例,请将示例代码复制到某窗体的声明变量部分。请确保该窗体包含:

名为 ListBox1 的列表框。

名为 CommandButton1 和 CommandButton2 的两个命令按钮控件。

Dim EntryCount As Single

Private Sub CommandButton1_Click()
    EntryCount = EntryCount + 1
    ListBox1.AddItem (EntryCount & " - Selection")
End Sub

Private Sub CommandButton2_Click()
    '确认列表框包含列表项
    If ListBox1.ListCount >= 1 Then
        '如果没有选中的内容,用上一次的列表项。
        If ListBox1.ListIndex = -1 Then
            ListBox1.ListIndex = _
                    ListBox1.ListCount - 1
        End If
        ListBox1.RemoveItem (ListBox1.ListIndex)
    End If
End Sub

Private Sub UserForm_Initialize()
    EntryCount = 0
    CommandButton1.Caption = "Add Item"
    CommandButton2.Caption = "Remove Item"
End Sub本回答被提问者采纳

以上是关于excel vba工具sharepoint怎么用的主要内容,如果未能解决你的问题,请参考以下文章

怎么用vba给excel 加密

如何使用 Excel VBA 将项目添加到 Sharepoint 列表?

访问 VBA 自动化能够将 Word 文档保存到 Sharepoint 但不能保存到 Excel 电子表格

Excel数据量太大,用VBA运算依然会耗时太久,运行很慢,该怎么办?

Excel vba 忘了密码 怎么办

excel表自杀用VBA如何编写?