Solved

Create executable from vbs

Posted on 2011-02-28
8
1,004 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

932 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

8 Experts available now in Live!

Get 1:1 Help Now