Forum Discussion
Excel Program not coming to foreground at PC start Windows10 touchscreen
I used this code to make it work, the sendkeys command had to be after a few lines of code to work other wise the program would not come to the foreground. AppActivate only gave me runtime error #5.
Private Sub Workbook_Open()
restartct = Sheets("search").Cells(1, 13)
If GetTickCount < 80000 Then
restartct = restartct + 1
Application.Wait (Now + 0.0001)
Application.WindowState = xlMaximized
frmBadinput.Label1 = "System Restarting"
SendKeys "%{tab}"
mdelay = 2
frmBadinput.Show
End If
frmWelcome.Show
Sheets("Search").Activate
ActiveSheet.Cells(1, 13).Value = restartct
ActiveSheet.Cells(5, 1).Select
ActiveWindow.Zoom = 120
End Sub
macro#1
Option Explicit
Public Declare Function GetTickCount& Lib "kernel32" ()