Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
run-time error 13: Type mismatch?
Hello!
I have on excel file what worked just fine for quite long time, but now suddenly when i open it first it will give me such a message:"this application is about to initialize ActiveX controls that might be unsafe. If you trust the source of this file, select ok and the controls will be initialized using your current workspace settings" i press ok there. And then I am receiving a run time error 13 type mismatch I press debug and this line with - is highlighted and if i put ' this before the line it takes next line yellow : Public Sub InitSheets() Set shtCreate = Application.Sheets(1) Set shtSwitch = Application.Sheets(2) Set shtMeas = Application.Sheets(3) Set shtAlarm = Application.Sheets(4) Set shtTrafo = Application.Sheets(5) - Set shtBayLR = Application.Sheets(6) Set shtStationLR = Application.Sheets(7) Set shtLineInd = Application.Sheets(8) Set shtGenerator = Application.Sheets(9) Set shtAR = Application.Sheets(10) Set shtTrip = Application.Sheets(11) Set shtSymbols = Application.Sheets(12) Set shtMappings = Application.Sheets(13) Set shtDataSrc = Application.Sheets(14) Set shtDefaults = Application.Sheets(15) End Sub First I thought that would be some regional settings problem but it doesn't seem to be. Thanks, |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
run-time error 13: Type mismatch?
I think some more investigation into the ActiveX control is probably needed.
Do you know what it might be? Couild be a 'link' control to gather information from the internet, or some special controls that look like buttons - many possibilities. As for why you're getting the type mismatch, it may be that shtBayLR is defined as another type somewhere else in code. As for putting the ' in front of the line and next one turning yellow, is that putting the ' at the start of a line turns it into a comment and the debugger is just moving to the next line that can be executed as a code statement and highlighting it in yellow. "Marko Enula" wrote: Hello! I have on excel file what worked just fine for quite long time, but now suddenly when i open it first it will give me such a message:"this application is about to initialize ActiveX controls that might be unsafe. If you trust the source of this file, select ok and the controls will be initialized using your current workspace settings" i press ok there. And then I am receiving a run time error 13 type mismatch I press debug and this line with - is highlighted and if i put ' this before the line it takes next line yellow : Public Sub InitSheets() Set shtCreate = Application.Sheets(1) Set shtSwitch = Application.Sheets(2) Set shtMeas = Application.Sheets(3) Set shtAlarm = Application.Sheets(4) Set shtTrafo = Application.Sheets(5) - Set shtBayLR = Application.Sheets(6) Set shtStationLR = Application.Sheets(7) Set shtLineInd = Application.Sheets(8) Set shtGenerator = Application.Sheets(9) Set shtAR = Application.Sheets(10) Set shtTrip = Application.Sheets(11) Set shtSymbols = Application.Sheets(12) Set shtMappings = Application.Sheets(13) Set shtDataSrc = Application.Sheets(14) Set shtDefaults = Application.Sheets(15) End Sub First I thought that would be some regional settings problem but it doesn't seem to be. Thanks, |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
run-time error 13: Type mismatch?
Perhaps the name of your 6th sheet has a space in it - if so, replace
the space with underscore. Hope this helps. Pete On Feb 5, 12:42*pm, Marko Enula <Marko wrote: Hello! I have on excel file what worked just fine for quite long time, but now suddenly when i open it first it will give me such a message:"this application is about to initialize ActiveX controls that might be unsafe. If you trust the source of this file, select ok and the controls will be initialized using your current workspace settings" i press ok there. And then I am receiving a run time error 13 type mismatch I press debug and this line with - is highlighted and if i put ' this before the line it takes next line yellow : Public Sub InitSheets() * * Set shtCreate = Application.Sheets(1) * * Set shtSwitch = Application.Sheets(2) * * Set shtMeas = Application.Sheets(3) * * Set shtAlarm = Application.Sheets(4) * * Set shtTrafo = Application.Sheets(5) - * *Set shtBayLR = Application.Sheets(6) * * Set shtStationLR = Application.Sheets(7) * * Set shtLineInd = Application.Sheets(8) * * Set shtGenerator = Application.Sheets(9) * * Set shtAR = Application.Sheets(10) * * Set shtTrip = Application.Sheets(11) * * Set shtSymbols = Application.Sheets(12) * * Set shtMappings = Application.Sheets(13) * * Set shtDataSrc = Application.Sheets(14) * * Set shtDefaults = Application.Sheets(15) End Sub First I thought that would be some regional settings problem but it doesn't seem to be. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
xpath error? Runtime Error 13 type mismatch | Excel Discussion (Misc queries) | |||
Type Mismatch Error - Help Please | Excel Worksheet Functions | |||
Type Mismatch Error | Excel Discussion (Misc queries) | |||
Visual Basic macro run time error(13) type mismatch | Excel Discussion (Misc queries) | |||
Why type mismatch - R/T error 13 | Excel Discussion (Misc queries) |