Eric Penfold
Active Member
- Joined
- Nov 19, 2021
- Messages
- 431
- Office Version
- 365
- Platform
- Windows
- Mobile
This code finds the folder fine but the line below says run time error 13?
Can`t see any mismatch errors please help.
Can`t see any mismatch errors please help.
VBA Code:
SubPath = CStr(Val(Int(CmdData(0) / 50) * 50 + 1) & "-" & Int(CmdData(0) / 50 + 1) * 50"
Option Explicit
Public Sub OpenFile(strFilePath As String)
ShellExecute Application.Hwnd, "Open", strFilePath, 0&, 0&, SW_HIDE
End Sub
Private Sub Open_DrNo_Pdf_Click()
Dim SourcePath
Dim SubPath As String
Dim PdfPath As String
Dim CmdData
CmdData = Split(OpenDrawing.Value, "_")
CmdData(0) = Replace(CmdData(0), "_", "")
SourcePath = "\\dc01\Company\R&D\R & D Projects\Drawing Nos"
SubPath = CStr(Val(Int(CmdData(0) / 50) * 50 + 1) & "-" & Int(CmdData(0) / 50 + 1) * 50)
PdfPath = SourcePath & SubPath & "\" & Int(CmdData(0)) & "\" & OpenDrawing.Value & ".Pdf"
Call OpenFile(PdfPath)
End Sub