Hi all,
Struggling a bit with this one.
Basically i have a sheet which is protected from user changes, easy enough to unprotect to update prior to automatically refreshhing.
My problem is I am using sendkeys to run a refresh on a third party software addin to excel which when runs just on its own code will do exactly what is required and takes a little time.
But after sending the sendkeys i want to pause/delay the macro to enable the third party to do it's things and then run a macro to re protect the sheet.
Here is my code for when i press my command button to run
the send keys code is
Now i'd like a pause or delay of a minute after the last send keys line is activated.
But when i try
All it seems to do is stop the sendkeys instructions to third party, effectively overriding that command.
As when i run the Sendkeys_test on its own it does what i want it to do i just cannot get a automatic delay afterwards to allow it to complete before processing further.
Any help would be gratefully appreciated all my research so far has drawn a blank and frustration.
Cheers
Struggling a bit with this one.
Basically i have a sheet which is protected from user changes, easy enough to unprotect to update prior to automatically refreshhing.
My problem is I am using sendkeys to run a refresh on a third party software addin to excel which when runs just on its own code will do exactly what is required and takes a little time.
But after sending the sendkeys i want to pause/delay the macro to enable the third party to do it's things and then run a macro to re protect the sheet.
Here is my code for when i press my command button to run
Code:
Sub refresh_PBCS_Data()
Dim ws As Worksheet
Dim Cell_das As Variant
Cell_das = Range("Cell_das")
MsgBox Cell_das
Sheet5.Unprotect Password:=Cell_das
Call sendkeys_test 'MsgBox ("This application is started!")
Sheet5.Protect Password:=Cell_das, userinterfaceOnly:=True
End Sub
the send keys code is
Code:
Sub sendkeys_test()
Application.SendKeys "%"
Application.SendKeys "s"
Application.SendKeys "dr"
Application.SendKeys "r"
End Sub
Now i'd like a pause or delay of a minute after the last send keys line is activated.
But when i try
Code:
Application.Wait (Now + TimeValue("0:01:00")
All it seems to do is stop the sendkeys instructions to third party, effectively overriding that command.
As when i run the Sendkeys_test on its own it does what i want it to do i just cannot get a automatic delay afterwards to allow it to complete before processing further.
Any help would be gratefully appreciated all my research so far has drawn a blank and frustration.
Cheers