cancel
Showing results for 
Search instead for 
Did you mean: 

Macro issue with Excel InPlace and Office 365 (source of the file is untrusted)

ACE-SAP
Active Contributor
0 Kudos

Hi,

We got an issue with Excel InPlace since the MS Office version was upgraded to O365.

When trying to use Excel Inplace option we get error :

Microsoft has blocked macros from running because the source of the file is untrusted

We have udpated the Excel template with the latest available version (1686797 - ALV Excel: Signed SAP standard templates ). The certificate is valid and issuer is trusted 

The issue is that the default location for temporary Excel file (as stated in 3338231 - Where are the temporary files saved when using the Excel Inplace function? ) is directory C:\Users\<User>\AppData\Local\Temp that cloud not be defined as safe in Excel Trusted Locations.

Even forcing this location as trusted using some registry tricks does not solve the issue
reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location15"
reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location15" /v "Path" /t REG_EXPAND_SZ /d %LOCALAPPDATA%\temp\
reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location15" /v "Description" /t REG_SZ /d "SAP Excel InPlace"
reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location15" /v "AllowSubfolders" /t REG_DWORD /d 1
reg add "HKCU\SOFTWARE\Microsoft\Office\16.0\Excel\Security\Trusted Locations\Location15" /v "Date" /t REG_SZ /d "02/19/2024 23:46"

Do you konw if there is a way to change where the Excel Inplace temporary files are stored ?
I did not find any info, changing the %TEMP% env. var. does not have an impact on localtion used to store Excel InPlace temporary files.

If it is not possible to change the location for temporary Excel Inplace files, what can we do to have Excel InPlace working with Office 365 ?

SAPGui version : 770 sp 7
SAP ECC6 Eph7 SPS 04
kernel 754 SP200

Thanks for your help

View Entire Topic
ACE-SAP
Active Contributor
0 Kudos

According to SAP support it is not possible to change the path used by SAP GUI to store temporary files for Excel in place.

Solution is to :

1) update the Excel template 1686797 - ALV Excel: Signed SAP standard templates

2) set the SAP certificate used to sign the macro of the template as trusted in Excel (could be done using a powershell command : import-Certificate -FilePath c:\temp\sapcert.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher)

You can then check in Excel option / trust center / Trusted publisher