Dim resPortfolio As Portfolio Dim ProfileRow as Profile ' Define a profile of row questions to add to Dim resItem As PortfolioItem Dim h For h = 1 to Survey.Questions.Count ' Iterate through every question of the survey Dim currQuestion = Survey.Questions[h] If currQuestion.Type <> "chapter" Then ' Only for non chapters ProfileRow.Add(currQuestion) ' Add the question to the row question profile Endif Next h resItem.SetType(1) resItem.SetTitle("Simple Holecount") resItem.TabDef.ReadTabTemplate("Askia Simple") resItem.TabDef.Rows.add(ProfileRow) ' Add the profile to the rows of the tab definition resPortfolio.Add(resItem) ' Add the tab definition to the portfolio resPortfolio.Save(Survey.Directory + "5. Simple Holecount.xml") resPortfolio.Open()