Share via

I have an issue with the QR code generated in Microsoft Excel. After generating it three months ago, it has now expired, and I need to update it.

NAIEEM Mina 0 Reputation points
2026-05-24T16:47:46.6+00:00

I have an issue with the QR code generated in Microsoft Excel. After generating it three months ago, it has now expired, and I need to update it.

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Hendrix-C 16,885 Reputation points Microsoft External Staff Moderator
    2026-05-24T20:46:05.9233333+00:00

    Hi @NAIEEM Mina,

    For your concern, as far as I know, a QR code image itself does not expire and the thing that usually expires is the link or the service behind the QR code.

    Therefore, for the best possible support, please share how you generated the QR code and what the QR opens/scans to (e.g. Excel add-in, website, Microsoft Forms, OneDrive link, etc.) so I can clearly understand the situation and guide you the appropriate steps to update that QR code.

    Please understand that my initial response may not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution. 

    Thank you for your understanding and cooperation. I look forward to hearing from you. 


    If you have extra questions, please click "Comment".      

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    Was this answer helpful?


  2. AI answer

    2026-05-24T16:47:59.0166667+00:00

    The QR code expiration and renewal are controlled in Microsoft Entra ID (Azure AD), not in Excel. Excel is only displaying or printing the image; updating the QR code must be done where the authentication method is managed.

    To update an expired QR code used for sign-in (QR code + PIN):

    1. Use Microsoft Entra admin center (GUI option)
      1. Open the Microsoft Entra admin center and go to the affected user.
      2. Go to the user’s Authentication methods and locate the QR code authentication method.
      3. Select Edit on the QR code authentication method.
      4. Either:
        • Change the expiration time for the standard QR code and select Save, then Done, or
        • Delete the existing QR code if it is expired/compromised, then select the + (add) icon to generate a new standard QR code for the user.
      5. Print or export the new QR code and then insert or update it in the Excel file (e.g., paste the new image into the worksheet).
      6. The user can continue to use the existing PIN unless the PIN is also reset.
    2. Use Microsoft Graph (API option) If QR codes are managed programmatically (for example, for many users), use Microsoft Graph to create or refresh a QR code and then update the image in Excel:
      • Create a temporary QR code for the user (valid up to 12 hours between startDateTime and expireDateTime):
             PATCH /users/{id | userPrincipalName}/authentication/qrCodePinMethod/temporaryQRCode
             
             {
               "startDateTime": "2024-10-30T12:00:00Z",
               "expireDateTime": "2024-10-30T22:00:00Z"
             }
        
      • Retrieve the temporary QR code:
             GET https://graph.microsoft.com/beta/users/{id|UPN}/authentication/qrCodePinMethod/temporaryQRCode
        
      • Replace the old QR code image in Excel with the newly retrieved QR code image.

    If the PIN associated with the QR code also needs to be reset, use the Entra admin center to generate a new temporary PIN (the user will be forced to change it at next sign-in), or use Microsoft Graph PIN reset endpoints, then communicate the new PIN to the user.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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