2

I created a workbook in Exceljs and added some worksheets dynamically do them. Basically I have a master worksheet that is the first thing you see when you open it up. However, I've also created player profiles for each person in my initial table. I'm trying to link them up with this piece of code.

    team.forEach((e, index) => {
      console.log(`--- Writing ${e.name} ---`)

      worksheet.addRow({
        teamName: e.teamName,
        name: e.name,
        weight: e.weight,
        wins: e.wins,
        losses: e.losses,
        profile: {
          text: 'This Profile',
          hyperlink: `${e.name}`
        }
      })

And unfortunately, this is just showing the text This Profile and it isn't able to be clicked on. Each of my worksheets are just the names of the people apart of the team. I am not sure if there is special syntax I need to add.

Here is how I am naming my workbook. I see all of the player profiles being created, just the hyperlinks aren't working.

async function writePlayerProfile(e, workbook) {
  let worksheet = workbook.addWorksheet(`${e.name}`)
4156
  • 380
  • 4
  • 17

2 Answers2

0

your code looks good but there is an issue in excel js maybe this will help you

hyperlink issue excel js

bhavesh
  • 453
  • 3
  • 11
-1

I believe that your hyperlink is wrong because the data is {e.name} that doesn't seem to have valid URL format.

owenizedd
  • 1,187
  • 8
  • 17
  • What's a valid URL format for internal sheets within a workbook? I just assumed that it would be the name of the sheet would be how you navigated around. I didn't know it needed to be a specific format. – 4156 Dec 06 '21 at 03:16