Solved

Create executable from vbs

Posted on 2011-02-28
8
1,002 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:Dushan911
  • 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:Dushan911
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
 
LVL 17

Author Comment

by:Dushan911
ID: 35002960
Thanks! It gives attached error.
DoRequest-error.JPG
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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:Dushan911
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:Dushan911
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

746 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

10 Experts available now in Live!

Get 1:1 Help Now