Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Create executable from vbs

Posted on 2011-02-28
8
Medium Priority
?
1,021 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
[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
  • 4
8 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 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
Industry Leaders: 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!

 
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 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

609 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