I tried the first option but it keeps telling me that it can't find the Energy+.idd file although its in the same directory.
Here is the code,
Private Sub CommandButton1_Click()
Dim RetVal
RetVal = Shell("C:\EnergyPlusV3-0-0\RunEplus.bat plant LasVegas", 4)
End Sub
Upon execution, a command window appears instantaneously then disappears, and no results are stored.
Appreciate your help.> I guess there's a couple options.
> 1) Modify your macro to run the EnergyPlus.exe directly and avoid the batch
> file. This would require setting up the input file and renaming it to
> in.idf, as well as copying your weather file to in.epw. Then you would
> post-process as necessary.
>
> 2) When you use the shell command, you have to be careful with your quotes
> if you are passing paths with directories and spaces. I have run batch
> files and such from VBA in the past, and I remember having some issues with
> the shell function, but that stuff's long gone with a reformat. If your
> issue is directly related to the shell function, you may have better luck
> hitting a vba forum. If you'd like to post a brief snip of your vba routine
> (only the relevant variables and calls), I'll have a look at it.
>
> Edwin
>> On Tue, Mar 17, 2009 at 5:51 PM, gadolio2002 <gadolio2002@...> wrote:> > --- In EnergyPlus_Support@xxxxxxxxxxxxxxx<EnergyPlus_Support%40yahoogroups.com>,
>
> > Thanks for the response Edwin. I've already tried to follow the
> > documentation, but it seems that when I execute the command to run the
> > simulation using the Shell function, it doesn't pass the input file name to
> > E+ batch file (the simulation initiates but stops soon sfter because no
> > input file was specified)?
> >
> > Thanks Again.
> >
> >
> > Edwin Lee <leeed2001@> wrote:
> > >
> > > To run E+ from a VBA macro, you'll probably just be starting an
> > executable
> > > through the shell. This can be found all over the place with google:
> > >
> > http://www.computing.net/answers/programming/vba-shell-function/2677.html
> > >
> > > for one.
> > >
> > > There is information in the AuxillaryPrograms.pdf documentation that
> > comes
> > > with E+ about how to run E+ directly, without a front-end. Just search on
> > > 'Running EnergyPlus by Hand'.
> > >
> > > Good luck...
> > > Edwin
> > >
> > > On Tue, Mar 17, 2009 at 5:03 PM, gadolio2002 <gadolio2002@> wrote:
> > >
> > > > Hi All,
> > > >
> > > > Can someone guide me through how to run an EnergyPlus Simulation using
> > > > Microsoft Visual Basic Macro (from Excel)?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > >
> >
> >
> >
>
__._,_.___