• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Runtime error '13' Type Mismatch. CDate

I assumed that you would know how to manually run the subroutine I posted.

Plan B: Temporarily modify your Exit button code this way to call the test code.
Code:
'Exit Button'
Private Sub cmbExit_Click()

'Debug code
Call SaveTest
Exit Sub
'End debug code (remove code after test)

Dim Shop_Order_Number As String
Dim txt As String
Dim ows As Worksheet
Dim ocs As Range
Shop_Order_Number = Trim(txtShopOrdNum)
Set ows = Worksheets("Master")
Set ocs = ows.Cells
For i = 2 To lastrow
If ocs(i, 4).Value = Shop_Order_Number Then
ocs(i, 1).Value = txtPrefix
ocs(i, 2).Value = cboStatus
ocs(i, 3).Value = txtSuffix
ocs(i, 4).Value = txtShopOrdNum
ocs(i, 5).Value = txtEmailSubLine
ocs(i, 6).Value = txtNotes
ocs(i, 7).Value = cboStage
ocs(i, 8).Value = CheckDate(txtStartDate)
ocs(i, 9).Value = CheckDate(txtStageDue)
ocs(i, 10).Value = CheckDate(txtEndDate)
'redacted columns 11-102'
Exit For
End If
Next i
If MsgBox("Save changes?", vbYesNo, "Exit form") = vbYes Then
    ThisWorkbook.Save 'NOT WORKING
    MsgBox "Your work is saved", vbOKOnly, "Exit form"
End If
MsgBox txt
Unload MasterForm
End Sub
 
I'm still so very new to VBA and appreciate the additional guidance.
Per the attached image, I received a error. The file resides on our company's sharepoint and when I hover over the highlighted line, it shows the correct location of the file. What's weird is that it shows the correct location, yet says the file is not found.

Run-time error '53' File not found.jpg
 
Before I look into this. I decided to test again, by 1. copying the file to My Documents (OneDrive) and 2. copying the file to an internal network mapped drive.
I ran both tests and got the same error. Each time, I hovered over the highlighted error and no matter where the file was located, the sharepoint breadcrumbs is what the code is looking for.
 
Back
Top