Solved

Create executable from vbs

Posted on 2011-02-28
8
1,009 Views
Last Modified: 2012-05-11
Hi Experts,
I'm working with vbsedit and trying to create an executable file as discussed on below question's final comments.

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_26846864.html
But I''m getting attached error.
I've attached reference window also to that image , which shows the dll libraries which I refereed.

I've had looked at following link and seems there is no security to access this function.
http://support.microsoft.com/kb/194801
But this code with working correctly from MS Excel Marco editor with adding dll files from reference.

Please let me know if there any luck of getting this work.

BR Dushan.


vbsedit.JPG
0
Comment
Question by:Dushan De Silva
  • 4
  • 4
8 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 35002247
The Reference there shows dfs.DataManager.

Perhaps change
Set datamgr = CreatEobject("DfsCmd.DataManager")

to
Set datamgr = CreatEobject("Dfs.DataManager")

and see what happens.

Regards,

Rob.
0
 
LVL 17

Author Comment

by:Dushan De Silva
ID: 35002825
Hi RobSampson,
Thanks a lot again for attending again!
Yes, it is working now.
But I'm getting error when I try to execute next line.

But seems I can't find ProgramID for DfsIos, please find attached image.
I can find DataIosMisc from the IOS.dll, but can't find ProgramID. I've login to IRESS and IOS from GUI. Also when macro is running I tried to trace it. But it's not listing as shows in the attached image.


BR Dushan.
ios-dll.JPG
missing-DfsIos.JPG
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 35002944
That object reference may not be required at all, if CreateOb("iosmisc") is a function of the datamgr object anyway.

Try using just this:

Sub Main()
    Set datamgr = CreateObject("Dfs.DataManager")
    Set misc = datamgr.CreateOb("iosmisc")
   
    With misc
    .Login
    .IOSName(0) = "testName"
    .AuthenticationType(0) = testAuth
    .User(0) = "usr"
    .Pass(0) = "pwd"
End With
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 17

Author Comment

by:Dushan De Silva
ID: 35002960
Thanks! It gives attached error.
DoRequest-error.JPG
0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 500 total points
ID: 35002999
OK, VBScript doesn't support optional arguments. I notice in your VB code, you have default values for those arguments, so let's just pass those default values.  Change this line:

    If Not DoRequest(misc) Then WScript.Quit

to this:

    iTimout = 20000
    bReqNext = False
    If Not DoRequest(misc, iTimeOut, bReqNext) Then WScript.Quit


Regards,

Rob.
0
 
LVL 17

Author Closing Comment

by:Dushan De Silva
ID: 35003040
Fantastic! Finally worked :)
sorry I forgot that we changed DoRequest function's default values of the parameters.

BR Dushan.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 35003112
Thanks for the grade.

Regards,

Rob.
0
 
LVL 17

Author Comment

by:Dushan De Silva
ID: 35003457
Hi RobSampson,
Thanks a lot for your great help!
I'm trying following example, which will request price information and will wait for responses and will give the outputs.
It's working correctly in Excel Marco editor. Seems we may need to do some more modifications to DoRequest function.

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_26854238.html

I would greatly appreciate that if you could have a look at it.

BR Dushan.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 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