Solved

VBScript runtime error '800a01c1'

Posted on 2002-05-27
9
1,510 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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 9

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 9

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP Button to clear text 4 69
ASP CDO - Limiting Connections 3 66
Html Table Looping (part 2) 5 35
Date on a table 16 37
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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