Re: Executing an external notebook within another notebook
- To: mathgroup at smc.vnet.net
- Subject: [mg93003] Re: Executing an external notebook within another notebook
- From: Szabolcs Horvat <szhorvat at gmail.com>
- Date: Wed, 22 Oct 2008 05:40:44 -0400 (EDT)
- Organization: University of Bergen
- References: <gdja5r$ieh$1@smc.vnet.net>
Tugrul Temel wrote: > Dear All, > > Recently, the issue of executing a notebook within another notebook has > arised and I worked on that for sometime. My progress has been limited and > I am stuck at the following point. > > 1) I wrote a generic "Common.nb" including the general code that can be > executed using different data set. > 2) I created another notebook "data.nb" retriving the data from Excel for > calculations using the codes from "Common.nb" > 3) I only open the "data.nb" and use Needs[] command to bring "Common.nb" > to the current "nb" file, it gives a lot of errors. > 4) If I only open the "Common.nb" and run it, it also gives errors. > 5) However, if I open both "data.nb" and "Common.nb" and run them > separately (the order of execution does not matter), then both programs > run properly, giving the desired outcomes. > 6) This shows that these two "nb" have somehow been linked to each other > without my intention. > I am not sure why this happens, just a note about point 3: You cannot use Needs to read in a notebook. Instead make the relevant cells in common.nb initialization cells, and save the notebook. Mathematica will offer to create an auto-save package for you (which will be called common.m). Now you can use Get["common.m"].
- Follow-Ups:
- RE: Re: Executing an external notebook within another notebook
- From: "Tugrul Temel" <temelt@xs4all.nl>
- RE: Re: Executing an external notebook within another notebook