Solved

VBScript runtime error '800a01c1'

Posted on 2002-05-27
9
1,488 Views
Last Modified: 2012-06-27
Hey Everyone,

I am getting this error when I am trying to access a vb component.  Is it because my component is not registering properly?  Does anyone have any suggestions?

Microsoft VBScript runtime error '800a01c1'

Argument not optional: 'GenerateExcelReport'

/excelreportmts.asp, line 69
0
Comment
Question by:rickydoyle
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 7037491
it is not that the component has not been registered. Your component has been successfully registered. The method requires an additional argument e.g.
GenerateExcelReport 1
or
GenerateExcelReport "string"

You have to know what arguments are required by this method and what data type is required, be they string, boolean or numeric or others.
0
 

Author Comment

by:rickydoyle
ID: 7037498
Ok, this is what I have in my asp page where I am gettign the error

sPath =oReport.GenerateExcelReport(cStr(strmaster),cStr(strRtype))

Then within my vb class I have this code
Public Function GenerateExcelReport(Master, RType) As String

To me everything looks fine with that so that is why I am confused on this.  

0
 
LVL 23

Accepted Solution

by:
b1xml2 earned 100 total points
ID: 7037526
Firstly,
your function shd be
Public Function GenerateExcelReport( _
ByVal Master As String, _
ByVal RType As String) As String

End Function

If you do not specify that, then the default is ByRef which may be the cause of the problem.

Check http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q197956

If you are passing by reference then, you must specify as variant

Public Function GenerateExcelReport(ByRef Master As Variant, ByRef RType As Variant) As String
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7037529
It may be that this may not be the cause of the problem. However, you should change your parameter types as this is considered prudent coding and unless you want to use the arguments's values which may be changed via the function, use the ByVal keyword instead.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 23

Expert Comment

by:b1xml2
ID: 7037533
also have a look at this

http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;Q244012

INFO: Type Mismatch Errors When You Pass Parameters from ASP to a Visual Basic Component (Q244012)
0
 

Author Comment

by:rickydoyle
ID: 7037599
I am unsure right now, I have looked at both articles and from the info you gave me everything looks like it should flow correctly but it is not.  I just installed IIS on my machine, would it have anything to do with settings I may have set up?
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 7038469
Does your component work outside of ASP?  Maybe something going on inside your component is throwing the error?
0
 
LVL 6

Expert Comment

by:Nitin Sontakke
ID: 7038885
This is just a random suggestion. You may NOT implement it. However, my experience with ASP / VB communication has following to share with you.

As VBScript (in which we write asp files) being a scripting language, does not support strongly typed variables, by default.

Somehow, i have never experienced problem with sending Integer as a function return value from VB to ASP. For this reason, i would recommend you to return integer value from VB function as -1 (Success) or 0 (Failure) in the function.

For returning string value to ASP, add yet another parameter ByRef.

After modifications, if you choose to do, your code will look something as follows:

VB:

Public Function GenerateExcelReport( _
ByVal Master As String, _
ByVal RType As String, _
ByRef strReturn As String) As Integer

ASP:

Dim iReturn, sPath

iReturn = oReport.GenerateExcelReport(cStr(strmaster),cStr(strRtype), sPath)

If iReturn <> 0 Then
   'Error occured in component.
End If
0
 
LVL 6

Expert Comment

by:Nitin Sontakke
ID: 7038892
Sorry, it should have been:

If iReturn = 0 Then
  'Error occured in component.
End If

You know what i am trying to say, anyway.

Also, this takes care of scenario "clockwatcher" is referring to.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now