Views

Histats

Vitrine

VBA Excel - Excel 2007 - Exportando para o Sharepoint

Tenho essa função num banco de dados Access 2007, que trabalha muito bem. É uma experiência inédita para alguns e uma necessidade preemente para outros. Exportar dados de uma planilha para o Sharepoint.


Function Export2SPoint()
Dim oFs As New FileSystemObject
Dim originalFolder As Folder
Dim destinationPath As String
Dim ofile As file
Dim XLApp As Excel.Application
Dim xlwb As Excel.Workbook
Dim strFileName As String
Dim oFolder As String

Let oFolder = "//chs114file1/dovpasres/Data/Script/InfoCentre/Delays"

Set oFs = CreateObject("Scripting.FileSystemObject")
Set XLApp = New Excel.Application

    Kill "K:\Data\Script\InfoCentre\Delays\*.xlk"

    Set originalFolder = oFs.GetFolder(oFolder)


    For Each ofile In originalFolder.Files

        Let strFileName = oFs.GetFileName(ofile)

            Set xlwb = XLApp.Workbooks.Open(ofile)

            xlwb.SaveAs (destinationPath + strFileName)

    Next

xlwb.Close True

XLApp.Quit

Set xlwb = Nothing
Set XLApp = Nothing
End Function

Tags: VBA, Excel, Sharepoint, Excel, export, 



✔ VBA Brazil®

✔ VBA Brazil®
brazilsalesforceeffectiveness@gmail.com
Related Posts Plugin for WordPress, Blogger...
diHITT - Notícias