Project.AddAllOpenDocuments
Add all open and visible documents to the project.
SVB Example
Creating a new project:
Sub Main 'Create the project through the application. Dim prj As Project Set prj = Application.NewProject 'We will embed our documents in this project. 'Specifically, we will only include spreadsheets, analyses, and results. prj.Options = scIncludeAnalysisResults Or scIncludeAnalyses Or scIncludeSpreadsheets Or scEmbed 'Add all open items (that meet our filter's criteria). prj.AddAllOpenDocuments 'Also add the 30PredictorsOfYield dataset. prj.AddDocument(Application.Open(Path & "\examples\datasets\30PredictorsOfYield.sta", True, False)) 'Save the project (change this to a path relative to your system). prj.SaveAs("c:\users\hcaulfield\Documents\StatsProject.spf") End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.