I tried the following code. No change in behavior:
Code:
Public Function fOpenWorkbook(pstrPath As String) As Boolean
Dim lboolOpenWorkbook As Boolean
'Set xlapp = Excel.Application
On Error Resume Next
Set xlapp = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set xlapp = CreateObject("Excel.Application")
End If
Err.Clear
On Error GoTo ErrOpenWorkbook
Set wbWorkbook = xlapp.Workbooks.Open(pstrPath)
xlapp.Visible = True
sSleep 1
wbWorkbook.Worksheets(1).Visible = True
xlapp.ActiveWindow.Activate
xlapp.WindowState = xlMaximized
lboolOpenWorkbook = True
ExitOpenWorkbook:
fOpenWorkbook = lboolOpenWorkbook
Exit Function
ErrOpenWorkbook:
MsgBox Err.Description, vbInformation, "Error in fOpenWorkbook"
Resume ExitOpenWorkbook
End Function
Code:
Option Compare Database
Option Explicit
Private dbCurrent As DAO.Database
Private vitem As Property
Private insert_statement, fld_val, psource, errmess
#If Win64 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr)
#Else
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
#End If
Public Sub sSleep(pintSeconds As Integer)
Sleep pintSeconds * 1000
End Sub
Do you all mind if I try to post this question on some other sites?