Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]() I don't know why the following code keeps coming back as a runtime error 13, type mismatch; I have checked the code several times and I can't 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.Va lue, "mmm dd yy") * MakeSTAR StarName MsgBox "Finished" End Sub -- hindlehey ------------------------------------------------------------------------ hindlehey's Profile: http://www.excelforum.com/member.php...o&userid=28617 View this thread: http://www.excelforum.com/showthread...hreadid=482792 |
#2
![]() |
|||
|
|||
![]()
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. hindlehey wrote: I don't know why the following code keeps coming back as a runtime error 13, type mismatch; I have checked the code several times and I can't 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.Va lue, "mmm dd yy") * MakeSTAR StarName MsgBox "Finished" End Sub -- hindlehey ------------------------------------------------------------------------ hindlehey's Profile: http://www.excelforum.com/member.php...o&userid=28617 View this thread: http://www.excelforum.com/showthread...hreadid=482792 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
type mismatch on saving excel calculation mode via VB app | Excel Discussion (Misc queries) | |||
Type mismatch mysterious error | Excel Discussion (Misc queries) | |||
[Q] Save As throws type mismatch error in control's code? | Excel Discussion (Misc queries) | |||
Database Query -- Data Type Mismatch | Excel Discussion (Misc queries) | |||
Type mismatch on LastRow | Excel Discussion (Misc queries) |