Excelquestion35
Board Regular
- Joined
- Nov 29, 2021
- Messages
- 53
- Office Version
- 2016
- Platform
- Windows
Hi all,
Having some issues with with my macro to work on a shared drive. I already tried changing the file path to the UNC structure but I keep getting the message that the file can not be found and therefore not be processed.
The file path of the document on the shared folder is as follows: C:\Users\bw\DPD\RvD- RPA-_UserID\WIP\Kronos Centraal Formulier v3.2 - Template (zonder check) - RPA versie.xlsm
Any clue on what the right file path should be? (skronos)
Below is the part of the code that concerns the file:
Having some issues with with my macro to work on a shared drive. I already tried changing the file path to the UNC structure but I keep getting the message that the file can not be found and therefore not be processed.
The file path of the document on the shared folder is as follows: C:\Users\bw\DPD\RvD- RPA-_UserID\WIP\Kronos Centraal Formulier v3.2 - Template (zonder check) - RPA versie.xlsm
Any clue on what the right file path should be? (skronos)
Below is the part of the code that concerns the file:
VBA Code:
Dim src As Worksheet
Dim tgt As Worksheet
Dim filterRange As Range, PasteRange As Range
Dim copyRange As Range
'Dim lastrow As Long
Dim customer As String
Dim Kronos As Workbook
Set src = Workbooks("Copy of Site overview (003) - 2.xlsm").Sheets("FLMs")
customer = Workbooks("Copy of Site overview (003) - 2.xlsm").Sheets("FLM-change2").Range("G17")
On Error Resume Next
skronos = "\\DPD\RvD- RPA-_UserID\WIP\Kronos Centraal Formulier v3.2 - Template (zonder check) - RPA versie.xlsm" 'path en filename Kronos
sp = Split(skronos, "\") 'splitten op "\"
Set Kronos = Workbooks(sp(UBound(sp))) 'workbook Kronos
bclosed = (Kronos Is Nothing) 'Kronos is niet open
If bclosed Then
Set Kronos = Workbooks.Open(skronos)
If Kronos Is Nothing Then MsgBox "Het Kronosformulier kan niet worden gevonden.": Exit Sub
Else: Worksheets("Supervisor (leidinggevende)").Unprotect 'later toegevoegd
End If
On Error GoTo 0