VBA SendKey Application Update

HazatB

New Member
Joined
Sep 19, 2017
Messages
32
Good Morning All,

I currently have a excel macro that uses SendKey to update an application. The current code works off two columns in excel (1) Has the name of the function (2) Has the Total Percentage for the function. The Macro checks the name by copying the application data and pasting it into a new column that identifies whether the naming conventions matching is True or False. The Macro then updates the percentage by taking the excel data and pasting it into the application.

I need to update the macro to change the name of the function within the application by adding _Lawson. Can anyone provide assistance on changing my code? My own attempt to solve this ran into issues getting the application to update, I created another column that will convert a name from for example V345-9 to V345-9_Lawson which worked but couldn't get the system to use this to update the application.

My Code
Code:
Sub CompleteSTARandExcelSendKeyCode()
'
' CompleteSTARandExcelSendKeyCode Macro
' Macro recorded 12/22/2010 by UMMS User
'
'
Dim EnterKey As String
Dim ThreeKey As String
Dim YesKey As String
Dim AccountKey As String
Dim rowkey As Integer
'-------------------
'AccountKey = "1620001739"
EnterKey = "~"
ThreeKey = "3"
YesKey = "Y"
rowkey = 1
    
    
    Do
    AppActivate ("Microsoft Excel - SendKey_UMMC.xls"), False
    Application.Sheets("Accounts").Select
    Range("A" & rowkey).Select
    
    
    AccountKey = Range("A" & rowkey)
    
    '================================================
    'STAR Send Key Code
    '================================================
    
    
    '=============================================
    'Select UMMC at the Facility Screen
    '=============================================
    AppActivate ("1 - HBOC_CLN"), False
    Application.SendKeys (ThreeKey), True
    Application.SendKeys (EnterKey), True
    'Enter the account number
    Application.Wait (Now + TimeValue("00:00:03"))
    AppActivate ("1 - HBOC_CLN"), False
    Application.SendKeys (AccountKey), True
    Application.SendKeys (EnterKey), True
    'Say Yes to Do you wnat to send charges for this account
    Application.Wait (Now + TimeValue("00:00:03"))
    AppActivate ("1 - HBOC_CLN"), False
    Application.SendKeys (YesKey), True
    Application.SendKeys (EnterKey), True
    'Say Yes to Add account to HPM index tranferring changes
    Application.Wait (Now + TimeValue("00:00:03"))
    AppActivate ("1 - HBOC_CLN"), False
    Application.SendKeys (YesKey), True
    Application.SendKeys (EnterKey), True

    '===========================================================
    'End of the STAR Code
    '===========================================================
    
    rowkey = rowkey + 1
    
    AppActivate ("Microsoft Excel - SendKey_UMMC.xls"), False
    Application.Sheets("Accounts").Select
    Range("A" & rowkey).Select
    
    
    AccountKey = Range("A" & rowkey)
    Application.Wait (Now + TimeValue("00:00:03"))
    Dim c As Range
    For Each c In Selection
    If c.Value <> "" Then c.Value = c.Value & "_01"
    Next
    Loop Until AccountKey = "END"
    
End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,215,497
Messages
6,125,158
Members
449,208
Latest member
emmac

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top