Hi @Susan Young
An error that keeps coming back at the code step is usually caused by old saved sign-in info on the PC, or by a wrong date, time or time zone, which breaks the sign-in.
Here are some suggestions you can try:
Go to Settings > Time & language > Date & time, turn on Set time automatically and Set time zone automatically, then click Sync now. Fixing the time zone has been reported to clear this exact "try again" loop.
Close all Office apps. Open Control Panel > Credential Manager > Windows Credentials and remove entries that mention MicrosoftOffice or Office. Restart and try again.
Run the Microsoft 365 activation troubleshooter. Open the Get Help app and search "activate Office".
Check https://account.microsoft.com/services to make sure the subscription is active and listed under the email you're using.
Also try with any VPN turned off or on a different network. If it still fails, please share the exact error text or code (blur any personal info).
More info: Unlicensed Product and activation errors in Office