Runtime Error 13 - type mismatch

  • Thread starter Thread starter hindlehey
  • Start date Start date
H

hindlehey

I don't know why the following code keeps coming back as a runtime erro
13, type mismatch; I have checked the code several times and I can'
find the problem - can anyone help me?

Option Explicit
Sub cmdclick()

Dim app As Application
Dim wkbk As Workbook
Dim shtctrl As Worksheet

Dim StarName As String

Set wkbk = ThisWorkbook
Set app = wkbk.Application
app.ScreenUpdating = False
Set wkbk = ThisWorkbook
Set shtctrl = wkbk.Worksheets("Control")

StarName = wkbk.Path & "\" & "STAR Week No " & _
wkbk.Names("WeekNo").RefersToRange.Value & " " & _
*Format(wkbk.Names("ControlDate").RefersToRange.Value, "mmm dd yy") *

MakeSTAR StarName

MsgBox "Finished"

End Su
 
Are you sure it's the code?

I'd check what was in those two ranges.

Then I'd check to see if each of those names referred to a single cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top