Enable Macro on Access Runtime machine (1 Viewer)

YellowLarry

New member
Local time
Today, 04:45
Joined
Mar 7, 2020
Messages
3
Access accde program cannot be executed. My computer is Windows 7 Professional 64 bits without Office installed while Access 2016 runtime is installed.

Before I add trust folder, I got Access Security Notice below.
Screen Shot 2020-03-07 at 11.27.48 AM.png

I use AddPath2016 to add Location to [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security\Trusted Locations] and Access Security Notice will not be shown up. It is good.

Now, I got below Macro error message and application cannot be executed.
Screen Shot 2020-03-07 at 9.58.05 AM.png

I use regedit to add [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Access\Security] "VBAWarnings"=dword:00000001
I add [HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Office\16.0\Access\Security] "VBAWarnings"=dword:00000001
Error message still pops up and cannot run application.

I do not have Office installed. I cannot use Trust Centre to enable Macro. How can I enable Macro on this Access runtime environment?
 

zeroaccess

Active member
Local time
Today, 06:45
Joined
Jan 30, 2020
Messages
671
Can you show us what is in the AutoExec macro of the .accde?
 

YellowLarry

New member
Local time
Today, 04:45
Joined
Mar 7, 2020
Messages
3
My code is below. It works on all other five computers. Some computers have runtime only while some have Office installed.

Public Function StartUp()

Dim Server As String, Login As String, DataName As String, Driver As String, str As String
Dim rs As DAO.Recordset

ap_SetNavigation (False)
ap_SetRibbon (False)
Set dbs = CurrentDb
On Error GoTo ServerErr

Set rs = dbs.OpenRecordset("SELECT * FROM CompanyInfo", dbReadOnly)
rs.Close

Driver = Nz(ELookup("TextValue", "ClientParameter", "Parameter='SQLDriver'"), "SQL Server Native Client 11.0")
Server = Nz(ELookup("TextValue", "ClientParameter", "Parameter='SQLServer'"), LarryiMacServer)
Login = Nz(ELookup("TextValue", "ClientParameter", "Parameter='SQLServerLogin'"), "Trusted_Connection=yes")
DataName = Nz(ELookup("TextValue", "ClientParameter", "Parameter='SQLDataBaseName'"), "Simple")
ODBCDSN = Nz(ELookup("TextValue", "ClientParameter", "Parameter='ODBCDSN'"), "Simple")

SQLServerName = Nz(ELookup("TextValue", "ClientParameter", "Parameter='SQLServer'"), "192.168.0.187\127.0.0.1,1433"
str = "Driver={" & Driver & "};Server=" & Server & ";Database=" & DataName & ";" & Login & ";"

DoCmd.OpenForm "Z_fmhidden", acNormal, , , , acHidden
dbsSQL.Open str
DoCmd.OpenForm M_Login

Exit Function

ServerErr:
DoCmd.OpenForm M_DatabaseSelection
End Function
 

zeroaccess

Active member
Local time
Today, 06:45
Joined
Jan 30, 2020
Messages
671
Do you have all of the necessary references enabled in the .accde?
 

zeroaccess

Active member
Local time
Today, 06:45
Joined
Jan 30, 2020
Messages
671
Set dbs = CurrentDb

Don't you need to declare your variable type? dbs as string?

Also, dbsSQL wasn't defined anywhere
 

YellowLarry

New member
Local time
Today, 04:45
Joined
Mar 7, 2020
Messages
3
Thank you for your help. All variables are defined on public area. Yes, necessary references are enabled before compiled it and .accde works on other computers.

With your reply, it hints me to check server. My ODBC driver configuration was changed before I used this computer and I did not have correct ODBC driver confirmation. After updating my ODBC driver configuration, problem solve. Thank you.
 

SunnyJamshedji

New member
Local time
Today, 04:45
Joined
Apr 16, 2010
Messages
11
Not sure the result of this thread, but here's what I did to make it work. These are the conditions of my situation:

I need to deploy using Windows Server 2019 and Access Runtime 2016. No way to open Trust Center and I cannot use a full copy of Access , because an RC tool I wrote in VB.NET back in 2007 requires some interfaces not available in full Office 365 AND MS does not allow both the Runtime and Full Office 365 Click To Run to install on the same machine at the same time! Crazy!
So, you cannot enable macros on this machine using the Trust Center as it doesn't have any real menus under it!
The certificate self-signing does not work if I move the DB file to another machine like a server.
And, I keep getting the macro warnings; not nice.
The DB is split into a Front End and Back End.

Located the German website in this thread that references Access Ribbons (cannot include the actual link here as it is being flagged as spam):

Used the information to locate the registry branch for Access 2016.
Found the Location# that corresponds to my Dev Box's folder where the DB resides and has already been designated as Trusted through Office 365 when first opened.
Exported this key to a registry file.
Copied registry file to the Server. I did not need to change my folder location as I leave it the same on the Server and Dev Box due to linked tables in Front End.
Imported the registry file.
Launched my DB app and it worked without the macro warnings.
All other folders are still safe.

Yes, someone could drop a malicious file in here, but then I've really got other problems I should be addressing!
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:45
Joined
Sep 21, 2011
Messages
14,038
You could try surrounding the link with simple text with no spaces and see if that would allow you to post, as that link would prove useful to others.
A few more posts would allow you to anyway.
 

joerg.kannengiesser

New member
Local time
Today, 12:45
Joined
Oct 18, 2022
Messages
1
Not sure the result of this thread, but here's what I did to make it work. These are the conditions of my situation:

I need to deploy using Windows Server 2019 and Access Runtime 2016. No way to open Trust Center and I cannot use a full copy of Access , because an RC tool I wrote in VB.NET back in 2007 requires some interfaces not available in full Office 365 AND MS does not allow both the Runtime and Full Office 365 Click To Run to install on the same machine at the same time! Crazy!
So, you cannot enable macros on this machine using the Trust Center as it doesn't have any real menus under it!
The certificate self-signing does not work if I move the DB file to another machine like a server.
And, I keep getting the macro warnings; not nice.
The DB is split into a Front End and Back End.

Located the German website in this thread that references Access Ribbons (cannot include the actual link here as it is being flagged as spam):

Used the information to locate the registry branch for Access 2016.
Found the Location# that corresponds to my Dev Box's folder where the DB resides and has already been designated as Trusted through Office 365 when first opened.
Exported this key to a registry file.
Copied registry file to the Server. I did not need to change my folder location as I leave it the same on the Server and Dev Box due to linked tables in Front End.
Imported the registry file.
Launched my DB app and it worked without the macro warnings.
All other folders are still safe.

Yes, someone could drop a malicious file in here, but then I've really got other problems I should be addressing!
Hi,
we have similar problems with the 2019 runtime: it is not possible to open another database via VBA-code !
We tested it with 2019 Full and logged the changes of the registry done by the trustcenter - but it seems, that the runtime does not use these entries (we allways get a warning message which CAN NOT be accepted !)
However: which registry-entries did you copy ?
Setting VBAWarnings to 1 worked for the full version but not for runtime; also we copied the Trusted Locations ...
the attachment show the warning without button to accept !?
 

Attachments

  • Warnmeldung.gif
    Warnmeldung.gif
    9 KB · Views: 96

Users who are viewing this thread

Top Bottom