Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
xpath error? Runtime Error 13 type mismatch Steve M[_2_] Excel Discussion (Misc queries) 0 January 17th 08 01:16 AM
Type Mismatch Error - Help Please Launchnet Excel Worksheet Functions 5 July 20th 07 04:35 AM
Type Mismatch Error David Excel Discussion (Misc queries) 2 December 11th 05 04:46 PM
Visual Basic macro run time error(13) type mismatch Paul Excel Discussion (Misc queries) 0 October 25th 05 07:28 AM
Why type mismatch - R/T error 13 Jim May Excel Discussion (Misc queries) 5 January 9th 05 06:45 PM


All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"