Your only 2 options in SQL is Windows auth (which always uses the current Windows user login) or SQL auth and they are not interchangeable. The correct solution here is to either use the actual WIndows user account or switch to SQL auth.
The only workaround would be to impersonate the user within the code. You can refer to this old thread on how to do that. But there are some caveats that you strongly need to consider first.
- To impersonate the user you need the username and password. Since this is being done inside an Excel file script you would either need to prompt the user for this information or hard code it. If you hard code the information then you're giving anyone access to this file credentials to the account effectively. The only reasonable security solution here is to prompt the user but now everybody using the file needs that information so it is not much more secure.
- VBA in Office is becoming more and more deprecated in lieu of the newer Javascript programming model and JS won't let you do impersonation for obvious reasons. So your solution is going to be dependent on stuff that is deprecated.
I would reevaluate why you need to use different credentials and resolve that issue instead. For example if the SQL in question needs to be accessed by many different users then set up some AD groups to contain the allowed users and then add the AD group (or even just the users) to SQL with the necessary rights. This is the most secure approach and allows you to "revoke" permissions for a user if needed.
If the issue is one of licensing (you only have 1 user CAL for example) then this is actually circumventing the licensing rules so you should just pay for more licenses. Alternatively create an API.
If the issue is that this is a legacy DB and you need access to it then consider creating an API that interacts with the database and then have Excel call the API instead. This eliminates the need for credentials and allows you to use the appropriate credentials in the API to talk to the database. Of course this mandates knowing how to write an API and then hosting it somewhere so it can be called.