64bit office, appactivate fails (1 Viewer)

wackywoo105

Registered User.
Local time
Yesterday, 23:33
Joined
Mar 14, 2014
Messages
203
I use

Code:
AppActivate "excel"

One PC now has 64 bit office and on this pc the code generates an error.

Can anyone help fix this?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:33
Joined
Oct 29, 2018
Messages
21,358
Hi. You may have to post the code for AppActivate(). If it's using API, you may have to adjust it.
 

wackywoo105

Registered User.
Local time
Yesterday, 23:33
Joined
Mar 14, 2014
Messages
203
I used to use
Code:
AppActivate (oXLApp)
but that ran into error with windows 10 vs 7 so I started using
Code:
AppActivate "Excel"

The code around it is:

Code:
Dim oXLApp As Excel.Application      'Declare the object variables
Dim oXLBook As Excel.Workbook
Dim oXLSheet As Excel.Worksheet
Set oXLApp = New Excel.Application   'Create a new instance of Excel
oXLApp.Visible = False

/Do some stuff/

oXLApp.DisplayAlerts = False
oXLBook.Save
oXLApp.DisplayAlerts = True
oXLApp.Application.EnableEvents = True
    
oXLApp.Visible = True
oXLBook.Activate
oXLApp.Application.WindowState = xlMaximized
    'Activate (oXLApp) - not used after became problematic
AppActivate "Excel" 
oXLSheet.Cells(selectrow, 3).Select
Set oXLSheet = Nothing
Set oXLBook = Nothing
Set oXLApp = Nothing

Both PC's that use this database have windows 10 64. One has office 64 bit and very soon the other one which is currently on 32 bit will too.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:33
Joined
Oct 29, 2018
Messages
21,358
Hi. But you still didn't show us what AppActivate does. There must be a separate function somewhere in your database called AppActivate(). No?
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:33
Joined
Sep 21, 2011
Messages
14,048
What do you mean by full name?

AppActivate "Microsoft Excel" doesn't work?

Do you mean the name as shown in the title bar? I tried that but it doesn't seem to work either. Maybe I am typing it wrong.

Yes. The link I pasted had an example of "Microsoft Word", so I presumed you would need to use "Microsoft Excel", which is what my Excel shows before I open any file.?

If your */Do some stuff/* changes the window title, then you would probably need to use that.?
 

Users who are viewing this thread

Top Bottom