VBA si fisiere SharePoint

tyro_excel_vba
Mesaje:27
Membru din:Joi Oct 18, 2018 3:07 pm
VBA si fisiere SharePoint

Mesaj de tyro_excel_vba » Joi Noi 08, 2018 11:29 am

Buna,

Am un cod care imi deschide un fisier excel salvat pe SharePoint si imi copiaza in el date din alt fisier stocat local.
Problema este la salvare, fisierul SharePoint se deschide ReadOnly si nu pot salva fisierul in acelasi loc cu acelasi nume.


Dim strExcelFilePathOne As String
strExcelFilePathOne="https://.............xlsx"
Dim myApp As Excel.Application
Dim wkBk As Workbook

Set myApp = CreateObject("Excel.Application")
myApp.Visible = msoTrue
Set wkBk = myApp.Workbooks.Open(strExcelFilePathOne, ReadOnly = False)
wkBk.Sheets("TRANSLATION DETAILED COSTS&VOL").Activate
wkBk.Sheets("TRANSLATION DETAILED COSTS&VOL").Paste


Vreo sugestie?

tyro_excel_vba
Mesaje:27
Membru din:Joi Oct 18, 2018 3:07 pm

Re: VBA si fisiere SharePoint

Mesaj de tyro_excel_vba » Lun Noi 12, 2018 4:41 pm

Am gasit o solutie:

Dim strExcelFilePathOne As String
strExcelFilePathOne="https://.............xlsx"
Dim myApp As Excel.Application
Dim wkBk As Workbook

Set myApp = New Excel.Application
myApp.Visible = msoTrue
Set wkBk = myApp.Workbooks.Open(strExcelFilePathOne, UpdateLinks:=False, ReadOnly:=False)
wkBk.Sheets("TRANSLATION DETAILED COSTS&VOL").Activate
wkBk.Sheets("TRANSLATION DETAILED COSTS&VOL").Paste

Scrie răspuns

Înapoi la “Visual Basic for Application (VBA) cu Excel - Intrebari tehnice”