user1486581
user1486581

Reputation: 1

Creating Folder in SharePoint in Windows Form Application using VB

I am working on a Windows Form application where i need to create a folder in a SharePoint Directory, then save an excel file in that folder.

The code i am using to currently save my excel file in the sharepoint directory works as inteded.

        Dim xlsApp As Microsoft.Office.Interop.Excel.Application = CreateObject("Excel.Application")
        Dim xlsWB As Microsoft.Office.Interop.Excel.Workbook
        xlsApp.Visible = True
        xlsWB = xlsApp.Workbooks.Open("H:\Records\1234_TEST.xls")
        xlsWB.SaveAs("//oil.Test.com/oil452-6603/TEST_FOLDER/1234_TEST.xls")

The problem i am having is i need to create a Folder in the SharePoint directory inside say "TEST_FOLDER" to actually put the excel file into. Im not going to be running this on the same computer as the sharepoint server, and i havent been able to figure a way to create a folder inside the sharepoint via code.

Adding the Folder via sharepoint manually is not an option because i need to create alot of these extra folders / excel files per folder.

Any help on what i need to do to be able to Create a folder so i can save my excel file into would be greatly appreciated. Thank You

Upvotes: 0

Views: 2164

Answers (1)

Aquila Sands
Aquila Sands

Reputation: 1471

You can use the SharePoint web services to do what you require, you'll want to use the Lists web service. See this blog post for an example of creating a folder (I haven't tested it but it looks good).

Upvotes: 1

Related Questions