Solved

VBScript runtime error '800a01c1'

Posted on 2002-05-27
9
1,520 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

734 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