Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I add this VB script to a VBA script?

I have the following VB script that I have recorded from a terminal session
at work. I wish to use this in a VBA script to manipulate the terminal to
action a repeated number of tasks to extract data and store in Excel. The
example below enters a bit of text and then actions the [enter] key.

I know I can use SendKeys and the like but the [enter] key throws up some
problems through SendKeys as the terminals I use don't always recognise the
[enter] passed by SendKeys.

Any suggestions on how I could change the format of the script below to work
within VBA would be much appreciated.

Cheers

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=testVB
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "12345ABCDE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
end sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Can I add this VB script to a VBA script?

Checkout:

http://msdn2.microsoft.com/en-us/lib...81(VS.60).aspx

Additinally, once the SendKeys have been issued, include a DoEvents. This
will help to insure that the receiving app will get focus long enough to
accept the keys.
--
Gary''s Student - gsnu200714


"Designated Dave" wrote:

I have the following VB script that I have recorded from a terminal session
at work. I wish to use this in a VBA script to manipulate the terminal to
action a repeated number of tasks to extract data and store in Excel. The
example below enters a bit of text and then actions the [enter] key.

I know I can use SendKeys and the like but the [enter] key throws up some
problems through SendKeys as the terminals I use don't always recognise the
[enter] passed by SendKeys.

Any suggestions on how I could change the format of the script below to work
within VBA would be much appreciated.

Cheers

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=testVB
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "12345ABCDE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
end sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can I add this VB script to a VBA script?

Thanks for pointing me in the right direction.

Appreciate your help.

Cheers

"Gary''s Student" wrote:

Checkout:

http://msdn2.microsoft.com/en-us/lib...81(VS.60).aspx

Additinally, once the SendKeys have been issued, include a DoEvents. This
will help to insure that the receiving app will get focus long enough to
accept the keys.
--
Gary''s Student - gsnu200714


"Designated Dave" wrote:

I have the following VB script that I have recorded from a terminal session
at work. I wish to use this in a VBA script to manipulate the terminal to
action a repeated number of tasks to extract data and store in Excel. The
example below enters a bit of text and then actions the [enter] key.

I know I can use SendKeys and the like but the [enter] key throws up some
problems through SendKeys as the terminals I use don't always recognise the
[enter] passed by SendKeys.

Any suggestions on how I could change the format of the script below to work
within VBA would be much appreciated.

Cheers

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=testVB
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "12345ABCDE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
end sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Can I add this VB script to a VBA script?

Any time Dave. If you come across a good site or book that assists with
conversion of VB to VBA, I would be interested.
--
Gary''s Student - gsnu200714


"Designated Dave" wrote:

Thanks for pointing me in the right direction.

Appreciate your help.

Cheers

"Gary''s Student" wrote:

Checkout:

http://msdn2.microsoft.com/en-us/lib...81(VS.60).aspx

Additinally, once the SendKeys have been issued, include a DoEvents. This
will help to insure that the receiving app will get focus long enough to
accept the keys.
--
Gary''s Student - gsnu200714


"Designated Dave" wrote:

I have the following VB script that I have recorded from a terminal session
at work. I wish to use this in a VBA script to manipulate the terminal to
action a repeated number of tasks to extract data and store in Excel. The
example below enters a bit of text and then actions the [enter] key.

I know I can use SendKeys and the like but the [enter] key throws up some
problems through SendKeys as the terminals I use don't always recognise the
[enter] passed by SendKeys.

Any suggestions on how I could change the format of the script below to work
within VBA would be much appreciated.

Cheers

[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=testVB
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
subSub1_

sub subSub1_()
autECLSession.autECLOIA.WaitForAppAvailable
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "12345ABCDE"
autECLSession.autECLOIA.WaitForInputReady
autECLSession.autECLPS.SendKeys "[enter]"
end sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA script Gor_yee Excel Discussion (Misc queries) 1 April 28th 09 10:43 AM
Need Help with Script DustinS Excel Programming 1 September 5th 05 02:53 PM
VB Script Steph[_3_] Excel Programming 3 June 1st 05 04:49 PM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
VB Script help Quanchi Excel Programming 3 October 6th 03 03:13 PM


All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"