Getting ORA-12154 - TNS: could not resolve service name error in Excel 365

Will Wong (MA) 5 Reputation points
2023-01-31T16:49:10.96+00:00
My client recently upgraded his Microsoft Office suite from 2016 to 365 on his workstation.   I am working with a him on getting his spreadsheet that was created in Excel 2016 (32 bit) connecting to a Oracle database.   He has no problem opening the spreadsheet in Excel 365.   However he is getting an ORA-12154 error when refreshing database connections.  I have confirmed the Excel 365 on his workstation is 64 bit.   He has configured a data source on the User DSN tab for the Oracle database with the Oracle 12c client 64 bit driver via the ODBC 64 bit Administrator.     He has his TNS_Admin system environment variable pointing to shared folder where the TNSNAMES.ora file resides.   He tested the data source in the ODBC 64 bit Administrator with no issue.

**One of the connection strings in the Excel Spreadsheet:**
DRIVER={Oracle in OraClient12Home1};SERVER=xxxxxxx;UID=john_doe;DBQ=xxxxxxx;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=Me;CSR=F;FWC=F;FBS=60000;TLO=O;MLD=0;ODA=F;


**TNSNAMES.ora:**
xxxxxxx.WORLD =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (COMMUNITY = TCP.world)(PROTOCOL = TCP)(Host = xxxx.xx.xx.xx)(Port = 1525))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = xxxxxxx.world)
    )
  )


**ODBC Data Source Entry:**
Data Source = xxxxxxx
Desccription = test database
TNS Service Name = xxxxxxx.world
User ID = john_doe
Driver = Oracle in OraClient12Home1

I have tested refreshing the data connections in Excel 2016 (32 bit) they work fine with the ODBC 32 bit data source created with the Oracle 12c client 32 bit driver.   Could anyone provide some insights on resolving the ORA-12154 error?
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,950 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,966 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.