Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Type Mismatch Error help understanding

I am using code developed by others as an example. In have made no changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If statement is
wrong?

Thanks in advance for your help.

Ray


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Type Mismatch Error help understanding

None of your code looks like it has anything to do with Excel. What is an
ICAPLib and a Component.ResultAttributes?

Where did you get the code from? What was the code supposed to do?

--
Regards,
Tom Ogilvy



Ray Batig wrote in message
link.net...
I am using code developed by others as an example. In have made no changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If statement is
wrong?

Thanks in advance for your help.

Ray




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Type Mismatch Error help understanding

Hi Tom,

The code came from Aspen Icarus which is part of the Aspen Engineering
software suite. Icarus estimates the cost of projects in industrial
settings. ICAPLib is a library of equipment specific descriptors ie. Slots.
Component.ResultAttributes are the slot values linked to individual
equipment. I seem to think that there is something wrong with the If
statement since CurSlot was = "" and thus it should have skipped the Then
part.

Don't know if this helps or not, however, thanks for looking at it.

Ray

Tom Ogilvy wrote in message
...
None of your code looks like it has anything to do with Excel. What is an
ICAPLib and a Component.ResultAttributes?

Where did you get the code from? What was the code supposed to do?

--
Regards,
Tom Ogilvy



Ray Batig wrote in message
link.net...
I am using code developed by others as an example. In have made no

changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If statement

is
wrong?

Thanks in advance for your help.

Ray






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Type Mismatch Error help understanding

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


Well you are getting type mismatch because CurSlot.ValueAsArray did not
return an array and aszTextArray therefore does not have an upperbound
(since it isn't an array).

if Component.ResutlAttributes should return an object (indicated by the fact
that you use set and typed curslot as ICAPLIB.Slot), then it should return
Nothing if there is no slot, rather than "". But I would expect an object
error on the set statement if it returned a null string.

--
Regards,
Tom Ogilvy




Ray Batig wrote in message
ink.net...
Hi Tom,

The code came from Aspen Icarus which is part of the Aspen Engineering
software suite. Icarus estimates the cost of projects in industrial
settings. ICAPLib is a library of equipment specific descriptors ie.

Slots.
Component.ResultAttributes are the slot values linked to individual
equipment. I seem to think that there is something wrong with the If
statement since CurSlot was = "" and thus it should have skipped the Then
part.

Don't know if this helps or not, however, thanks for looking at it.

Ray

Tom Ogilvy wrote in message
...
None of your code looks like it has anything to do with Excel. What is

an
ICAPLib and a Component.ResultAttributes?

Where did you get the code from? What was the code supposed to do?

--
Regards,
Tom Ogilvy



Ray Batig wrote in message
link.net...
I am using code developed by others as an example. In have made no

changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If statement

is
wrong?

Thanks in advance for your help.

Ray








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Type Mismatch Error help understanding

Hi Tom,

Thanks for the insight. I have not solved the problem yet but will keep
trying.

Regards,
Ray

Tom Ogilvy wrote in message
...
Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


Well you are getting type mismatch because CurSlot.ValueAsArray did not
return an array and aszTextArray therefore does not have an upperbound
(since it isn't an array).

if Component.ResutlAttributes should return an object (indicated by the

fact
that you use set and typed curslot as ICAPLIB.Slot), then it should return
Nothing if there is no slot, rather than "". But I would expect an

object
error on the set statement if it returned a null string.

--
Regards,
Tom Ogilvy




Ray Batig wrote in message
ink.net...
Hi Tom,

The code came from Aspen Icarus which is part of the Aspen Engineering
software suite. Icarus estimates the cost of projects in industrial
settings. ICAPLib is a library of equipment specific descriptors ie.

Slots.
Component.ResultAttributes are the slot values linked to individual
equipment. I seem to think that there is something wrong with the If
statement since CurSlot was = "" and thus it should have skipped the

Then
part.

Don't know if this helps or not, however, thanks for looking at it.

Ray

Tom Ogilvy wrote in message
...
None of your code looks like it has anything to do with Excel. What

is
an
ICAPLib and a Component.ResultAttributes?

Where did you get the code from? What was the code supposed to do?

--
Regards,
Tom Ogilvy



Ray Batig wrote in message
link.net...
I am using code developed by others as an example. In have made no

changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At

this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If

statement
is
wrong?

Thanks in advance for your help.

Ray












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default <Tom Ogilvy Type Mismatch Error help understanding

Hi Tom,

With your guidance and some digging I determined that I had opened the
Results, however, I had not loaded it. This did not provide any error
message. Once I loaded and opened the results everything worked. Thanks
again for your help and insight!

Regards,
Ray
Ray Batig wrote in message
link.net...
Hi Tom,

Thanks for the insight. I have not solved the problem yet but will keep
trying.

Regards,
Ray

Tom Ogilvy wrote in message
...
Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At this
point, aszTextArray is Empty and CurSlot =""


Well you are getting type mismatch because CurSlot.ValueAsArray did not
return an array and aszTextArray therefore does not have an upperbound
(since it isn't an array).

if Component.ResutlAttributes should return an object (indicated by the

fact
that you use set and typed curslot as ICAPLIB.Slot), then it should

return
Nothing if there is no slot, rather than "". But I would expect an

object
error on the set statement if it returned a null string.

--
Regards,
Tom Ogilvy




Ray Batig wrote in message
ink.net...
Hi Tom,

The code came from Aspen Icarus which is part of the Aspen Engineering
software suite. Icarus estimates the cost of projects in industrial
settings. ICAPLib is a library of equipment specific descriptors ie.

Slots.
Component.ResultAttributes are the slot values linked to individual
equipment. I seem to think that there is something wrong with the If
statement since CurSlot was = "" and thus it should have skipped the

Then
part.

Don't know if this helps or not, however, thanks for looking at it.

Ray

Tom Ogilvy wrote in message
...
None of your code looks like it has anything to do with Excel. What

is
an
ICAPLib and a Component.ResultAttributes?

Where did you get the code from? What was the code supposed to do?

--
Regards,
Tom Ogilvy



Ray Batig wrote in message
link.net...
I am using code developed by others as an example. In have made no
changes
to it so I presume it should work. Here it is:

Dim aszTextArray As Variant
Dim CurSlot As ICAPLib.Slot
Dim nNum As Long

Set CurSlot = Component.ResultAttributes

If Not CurSlot Is Nothing Then
aszTextArray = CurSlot.ValueAsArray
nNum = UBound(aszTextArray) < I get the error here . At

this
point, aszTextArray is Empty and CurSlot =""


What is this error trying to tell me? Any ideas if the If

statement
is
wrong?

Thanks in advance for your help.

Ray












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
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Type Mismatch Error - Help Please Launchnet Excel Worksheet Functions 5 July 20th 07 04:35 AM
Why type mismatch - R/T error 13 Jim May Excel Discussion (Misc queries) 5 January 9th 05 06:45 PM
Type Mismatch Error Need Help Ray Batig Excel Programming 1 September 16th 03 12:57 AM
Type mismatch error Stuart[_5_] Excel Programming 0 August 16th 03 05:20 PM


All times are GMT +1. The time now is 04:38 PM.

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"