
Hi @Long, Michael (Contractor) ,
Great to see that you've managed to sorted the issue out and really appreciated it for your sharing!
Since the Microsoft Q&A forum has a policy that the question author cannot accept their own answer, they can only accept answers by others. And according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread so that it can be easier for other community users to find useful information:
[Microsoft Teams, Powershell and Excel - Summary]
Issue Symptom:
"I prototyped a working powershell script that will enable the extraction of a specific named worksheet from an xslx file (it's not the first sheet), then update that same worksheet's workbook with updated values. When I try to run my script against the same file, that is now uploaded to Microsoft Teams, I only see the first worksheet of the file in powershell. "
Solution:
"From MS Teams, you can right-mouse-click a shared file, and get it's link. That direct link is the one I was successfully connecting to with PS ... but it only had one worksheet.
So I took another look at the link I copied and noticed a lot of trailing information beyond the file name like:
.xlsx?d=wa791f45b0e1f478397e9b573d6d1061a&csf=1&web=1&e=5IMunM
Back to my test script, I decided to update the excel file path link and remove all the html parameters starting with the ? and beyond.
Then I re-ran my test script which counts all the worksheets.
This time, all the worksheets were available!"
You could "Accept Answer" for this summary to close this thread, and your action would be helpful to other users who encounter the same issue and read this thread. Thanks for your understanding!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, 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.