Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-07-2017, 02:27 AM
Harley Harley is offline
Registered User
 
Join Date: Dec 2017
Posts: 1
Run script based on return value

Hi all. My first post.
I am not at all familiar with how vbscript ties into VB Macros(Excel) I am proficient at VB/VBA
I have access limitations but have not yet found their limit.

I have created VBA macros to simplify some major task within PWS.
Now comes my issues.
Within an excel macro which is using SENDKEYS to perform some very repetitive function, I need to run a VBscript within PWS to detect and return specific text on the screen.
Can someone please assist with this or at least help out with an alternative way to get the same result.

Is there any vbscript that can be invoked to help me achieve this.
My VBA code becomes very intimidating if I am to use API's within Excel.

Thanks in anticipation

Code:
Sub TruckLoad(First As String, Second As String, Temperature As String)
Dim TLPrinted As Boolean
    SendKeys "{NUMLOCK}"
    LastRow = Sheets("Outbound").Cells(Sheets("Outbound").Rows.Count, "H").End(xlUp).Row
    AppActivate "Paperless - Rand"
  '          SendKeys "{F1 8}"
  '          SendKeys First
  '          SendKeys "{ENTER}"
  '          SendKeys Second
  '          SendKeys "{ENTER}"
  '          SendKeys "ALL"
  '          SendKeys "{ENTER 5}"
    For I = StartLine To EndLine
        If UCase(Sheets("Outbound").Range("Y" & I)) = "X" And Sheets("Outbound").Range("K" & I) = Temperature Then
            SendKeys ClientCode(I) & Sheets("Outbound").Range("H" & I)
            SendKeys "{ENTER 2}"
            TLPrinted = True
        End If
    Next I
        If TLPrinted Then
            SendKeys "{ENTER 7}"
            SendKeys Format(Sheets("Outbound").Range("D4"), "dd.mm.yyyy")
            SendKeys "{ENTER 2}"
            SendKeys "LOAD"
AT THIS POINT I NEED TO KNOW THE RETURNED VALUE OF PASSING "LOAD" TO PWS
            SendKeys "{ENTER 2}"
            Sheets("Outbound").Range("AA" & I) = "TL"
            TLPrinted = False
        End If
End Sub
Reply With Quote
  #2  
Old 12-07-2017, 08:16 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,322
Hi Harley,

Is there any product of ours involved in your project?

See this post for a description of the intent of the VanDyke Software forums.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
script working with vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:53 AM.