PipelineStudio Gas Simulator Module Excel_English
Short Description
Download PipelineStudio Gas Simulator Module Excel_English...
Description
GAS NETWORK TRAINING MODULE : EXCEL
Gas Network Training PipelineStudio Training: Module Excel ............................................................................................ I The Module ......................................................................................................................................... I The User .............................................................................................................................................. I The Training ........................................................................................................................................ I PipelineStudio as a component in an Integrated System ............................................................ 1 1. PipelineStudio Configuration ........................................................................................................ 1 2. Command line arguments ............................................................................................................. 4 2.1 Examples .................................................................................................................................. 6 3. Control Options .............................................................................................................................. 8 3.1. Export of Transient Scenario.............................................................................................. 8 3. 2. Addition of fluid data in Import/Export of Initial Data ....................................................... 8 4. PipelineStudio import and export file formats .............................................................................. 9 5. Creating simple VBA macros ...................................................................................................... 10 5.1. VBA Example 1 ................................................................................................................. 11 6. Case Study: Using Microsoft Excel to automate an integrated PipelineStudio system.......... 11 7. Example Macro Code .................................................................................................................. 14
i
Gas Network Training
PipelineStudio Training: Module Excel The Module The module contains a series of examples about how to interact pipelinestudio and Excel. The case will illustrate input and output data in Excel environment. The User This pipelinestudio Training Class is intended to the users of the product or someone who wants to become more productive using pipelinestudio. The goal of the pipelinestudio training class is to provide a pipeline engineer, technician or professional with all of the skills and familiarity with the product needed to allow them to begin making productive and efficient use of the product. The Training pipelinestudio Training is being provided in a laboratory-type environment with the intent to provide the trainee with an interactive and high-ratio of hands on experience. The purpose of this is to keep things interesting and provide better overall retention by the student. pipelinestudio training is divided into ordered and methodical labs to allow the user to build on skills obtained from the previous lab and maximize the retention of knowledge associated with this training. Lecture and discussion will be incorporated into the labs themselves.
I
Gas Network Training
PipelineStudio as a component in an Integrated System Introduction pipelinestudio is a powerful product permitting both steady-state and transient analysis of very complex gas or liquid pipeline networks. Typically pipelinestudio is applied as a stand alone product by engineering, operational and marketing end users. However, pipelinestudio also has some very powerful features that permit it to be used as a component in a larger scale system. When integrated as a component, a system calls pipelinestudio from a command line, together appropriate arguments permitting the import of boundary conditions, scenario and simulation options, and executes a simulation. This data may then be read back into the parent application (normally from trend plot files). Further manipulation of the output data may also be performed automatically to present the data in a format that the end user feels more comfortable with. The ultimate goal of such an application is to present an end user who has no knowledge of hydraulic simulation with a tool that makes is easier for them to operate and profit the pipeline in a safe manner, therefore minimising the need for them to have a detailed understanding of hydraulics and simulation technology. This guidance program investigates the features of pipelinestudio which permit this integration to take place; the input and output file formats which pipelinestudio requires and the use of a parent application (Microsoft Excel) to create files, drive pipelinestudio and ultimately read the data back into the application.
1. PipelineStudio Configuration The foundation of this program is the investigation of the integration of pipelinestudio with other applications; hence a relatively simple point to point pipelinestudio Gas configuration consisting of 20 pipeline sections of one mile length and 12” internal diameter will be used as the baseline. The purpose of the number of leg segments is that it permits us to trend pressure and flow at more intervals than simply the ends of the pipe. A supply will be connected to the upstream and a volumetric delivery to the downstream points of the pipeline configuration. In general default pipelinestudio properties should be used to prevent excessive time constructing the model. The input fluid will be the default Gulf Coast Gas from the TGNET Library; this should be available from the drop down menu on the supply dialogue. To reflect this choice a compositional equation should be selected, to determine the fluid density and compressibility, from the simulation options (BWRS recommended), though this is not essential as the default SAREM equation can calculate the required fluid properties from the fluid composition (though a warning message is presented on model validation this would be ultimately hidden from an end user if the correct arguments are used). Ultimately with this model the inlet and outlet flow boundaries will be varied over time, however this does not preclude the fact that for an initial steady state solution an initial pressure boundary set point is required. The model will be run initially as a PQ model; i.e. initial control pressure upstream and flow downstream. An upstream flow constraint and a downstream pressure constraint will also be provided. The upstream flow constraint permits variance of the upstream
1
Gas Network Training flow set point, the downstream pressure constraint prevents the pressure from backing into sub ambient pressure conditions. An upstream mode of control of Maximum Pressure, with a Maximum Pressure set point of 1000 psig, and an upstream Maximum Flow constraint of 75 MMSCFD will be used; and downstream a Maximum Flow control with a Maximum Flow set point of 50 MMSCFD and a downstream a Minimum Pressure constraint of 900 psig will be used. As this configuration is relatively straightforward the default naming convention may be used. The following data items should be trended for each device: SUPPLY: Flow, Pressure, Mode DELIVERY: Flow, Pressure, Mode PIPE: Upstream Flow, Downstream Flow, Upstream Pressure, Downstream Pressure, Upstream Velocity, Downstream Velocity, Inventory (you can use the “Apply to All” button to apply the trend settings to all pipes). In this configuration this gives us 140 trended data items, or 141 columns in the output file we will be using to import data back in to Excel. Excel can only support a maximum of 256 columns in a single worksheet without wrapping data around, in which case further data processing may be required. It is advised that the capabilities of the parent application are checked to ensure they can deal with the data processing required without too much further work. Additionally Excel supports 65536 rows of data in a single worksheet, whilst this is unlikely to be breached in normal simulations, in the cases where trending occurs at small time intervals (such as when the minimum time step is used by pipelinestudio for long periods of time, due to, for example, excessive mode swapping or depressurization of the pipeline in the simulation, with trending set to maximum). This, of course, is simply a suggested configuration and components may be added or removed as required, but the presented material is based solely on this configuration. The theory presented is essentially the same whether you are looking at liquid or gas, or other equipment elements such as valves, compressors or pumps. It is important to make a note at this stage that a successful implementation of an integrated pipelinestudio application is highly dependant on a robust model. That is to say, as far as possible, errors need to be hidden from an end user. Errors can include such things as validation failure, steady-state failure, or a slow transient due to continuous use of the minimum time step. Many of these problems may be avoided by careful use of the constraint logic within pipelinestudio, and rudimentary error checking in the parent application. Once the configuration has been developed save it in a sensible directory structure, such as “C:\Studio_Integration\Configurations”, with a sensible filename, such as “Baseline_Configuration.tgw”. Generally the shorter the file path the better as it reduces the likelihood of input errors when developing integrated applications.
2
Gas Network Training
3
Gas Network Training 2. Command line arguments The primary feature this course will concentrate on will be the use of command line arguments and appropriate input and output files. Prior to investigation of the arguments which may be used to initiate a pipelinestudio instance from a command line, it is important to find out how to start a pipelinestudio instance form a command line. There are several ways this may be done. The first way is to use the direct address to pipelinestudio; the default for this would be: C:\> C:\Program Files\Energy Solutions\PipelineStudio (version) \Plstudio\Plstudio.exe Try entering this at a command prompt (HINT: Use Start | Run and type cmd in the open dialogue box). Alternatively you can add the path to the pipelinestudio executable file to the main environment path. This can be done permanently by selecting the advanced option from the system properties dialogue and then selecting the environment variables button. Alternatively it can be added temporarily until a command prompt is closed by the following command in a command prompt: C:\> PATH = %PATH%; :\> C:\Program Files\Energy Solutions\PipelineStudio (version)\Plstudio\ Note in this case Plstudio.exe is not added to the end of the path. pipelinestudio may now be started from the command prompt thus: C:\> Plstudio Or C:\> Plstudio.exe Remember if the path is added temporarily to a command window that when you close the command window new path will be lost. Finally it is possible to initiate apipelinestudio session from a command window using the following command: C:\> start Plstudio The start command normally has knowledge of the path to pipelinestudio and will initiate a pipelinestudio session. Because this session looks at the command line arguments available in pipelinestudio some additional files need to be created to import into. This may done very simply using Notepad, Excel or another text editing program. The files that will be created will be a simple setpoint file and a simple scenario file. The formats of these files and the requirements for these files will be discussed in more detail during this training session.
4
Gas Network Training The setpoint file should be named “setpoints.csv” and saved in the same directory as the pipelinestudio configuration. It should include the following line: Delivery,Deliv0001,FLMX,40 The scenario file should be named “scenario.csv” and be saved in the same directory as the pipelinestudio configuration file. It should include the following lines: Device Type,Device Name,Setpoint,1,2,3,4,5,6 Delivery,Deliv0001,FLMX,45,50,55,50,45,50 Once these files have been created the investigation of the available command may now begin. The following commands are available for TGNET or TLNET. PLStudio xyz.tgw
Open xyz.tgw (gas model only)
PLStudio xyz.tlw
Open xyz.tlw (liquid model only)
PLStudio xyz.kw
Import xyz.kw
PLStudio xyz.kws
Import xyz.kws
PLStudio /ImportKeywordFile xyz.kw
Import xyz.kw
PLStudio /ExportKeywordFile xyz.tgw
Export the keyword file for the pipelinestudio configuration xyz. (gas model only)
PLStudio /ExportKeywordFile xyz.tlw
Export the keyword file for the pipelinestudio configuration xyz. (liquid model only)
PLStudio /importdata abc.csv xyz.tgw
Open the specified file and immediately import Initial Data from abc.csv
PLStudio /?
Display help for command line flags (by opening a help file on this topic)
PLStudio /p xyz.tgw
Print default network view of a file to default printer and closes pipelinestudio automatically after printing completes.
PLStudio /pt name xyz.tgw
Print default network view of a file to specified printer/driver/port
PLStudio /scenariodata abc.csv xyz.tgw
Specifies a file from which to read scenario data. You can do this using batch (BAT/CMD) files or via the Run item on the Windows Start menu.
PLStudio /RunSteady xyz.tgw
Requests that a steady-state simulation be run automatically upon program startup (after any import of data).
PLStudio /RunTransient xyz.tgw
Requests that a transient simulation be run automatically upon program startup (after any import of data)
PLStudio /RunSteady /CloseWhenFinished xyz.tgw
Requests that pipelinestudio be closed automatically when a steady-state or transient simulation finishes. NOTE: This command line argument can only be used in conjunction with either -RunSteady or -RunTransient.
PLStudio /RunTransient /CloseWhenFinished xyz.tgw PLStudio /RunSteady /StartMinimized /CloseWhenFinished xyz.tgw PLStudio /RunTransient /StartMinimized /CloseWhenFinished xyz.tgw PLStudio /importKeywordfile abc.kw /SaveConfig xyz.tgw /CloseWhenFinished
Requests that pipelinestudio be started up minimized and closed automatically when a steady-state or transient simulation finishes. NOTE: This command line argument can only be used in conjunction with either RunSteady or -RunTransient. Requests that pipelinestudio be started up and closed automatically when the keyword file is imported and saved as a pipelinestudio configuration.
5
Gas Network Training 2.1 Examples In each example, we give the command line that you would enter (in a DOS window or in the "Open" box displayed by choosing Run… from the Windows Start menu). Following the command line, we describe of what would happen. Note: You do not need a command line flag before the tgw/tlw/ file name, but it must be specified as the last item on the command line. Otherwise, the order of command line flags is unimportant (except that file names must immediately follow flags which require them) The followings are examples of using the commands /scenariodata, /RunSteady, /RunTransient and /CloseWhenFinished. These examples refer to gas (.tgw) files, but these features will also work with liquid (.tlw) files. 2.1.1. Example 1 C:\Program Files\Energy Solutions\PLStudio\plstudio.exe C:\data\demo.tgw This would, in order: •
start pipelinestudio
•
open the demo.tgw file from the c:\data folder
2.1.2. Example 2 start plstudio /RunTransient C:\data\demo.tgw This would, in order: •
start pipelinestudio
•
open the demo.tgw file from the c:\data folder
•
run a transient simulation
6
Gas Network Training 2.1.3. Example 3a C:\Program Files\Energy Solutions\PLStudio\plstudio.exe /scenariodata C:\data\demoscen.csv C:\data\demo.tgw This would, in order: •
start pipelinestudio
•
open the demo.tgw file from the c:\data folder
•
import scenario data from the demoscen.csv file in the c:\data\ folder.
2.1.4. Example 3b C:\Program Files\Energy Solutions\PLStudio\plstudio.exe /scenariodata C:\data\demoscen.csv /RunSteady C:\data\demo.tgw This would do the same as the previous example and then run a steady-state simulation.
2.1.5. Example 4 C:\Program Files\Energy Solutions\PLStudio\plstudio.exe /importdata C:\data\demoinit.csv /scenariodata C:\data\demoscen.csv C:\data\demo.tgw This example shows the /scenariodata flag combined with the /importdata flag. This would, in order: •
start pipelinestudio
•
open the demo.tgw file from the c:\data folder
•
import initial data from the demoinit.csv file in the c:\data\ folder
•
import scenario data from the demoscen.csv file in the c:\data\ folder.
2.1.6. Example 5 C:\Program Files\Energy Solutions\PLStudio\plstudio.exe /RunTransient /CloseWhenFinished C:\data\demo.tgw This would, in order: •
start pipelinestudio
•
open the demo.tgw file from the c:\data folder
•
run a transient simulation
•
close pipelinestudio
7
Gas Network Training 2.1.7. Example 6 C:\Program Files\Energy Solutions\PLStudio\plstudio.exe /RunTransient /StartMinimized /CloseWhenFinished C:\data\demo.tgw This would, in order: •
start pipelinestudio minimized
•
open the demo.tgw file from the c:\data folder
•
run a transient simulation
•
close pipelinestudio
3. Control Options The Control Options are a subset of values that are normally set via the Simulation | Options… menu. Using the File | Export | Option Data… menu option causes a Control Options file to be written to the selected folder. This (plain text) file will contain the options along with their current value in the selected configuration. When the Control Options are imported any number of the control options can be omitted from the import file. The import file can contain one, a selection, or all the control options that are exported. The format of the Control Options file is Comma Separated Value (CSV) so it can be easily edited either in a text editor or any other application that supports the CSV file format such as Microsoft Excel. Control options can be imported and exported either by the menu option File | Export | Option Data… and File | Import | Options Data… or from the command line using the flags /ImportOptions options_data_file_name.csv or /ExportOptions options_data_file_name.csv. See the online help file in pipelinestudio for more information on working with pipelinestudio from the command line.
3.1. Export of Transient Scenario The Transient Scenario can now be exported either via the menu File | Export | Scenario Data… or the command line using the flag /ExportScenario scenario_data.csv . The format of the scenario data file is Comma Separated Value (CSV) so it can be easily edited either in any text editor or other application that supports the CSV file format such as Microsoft Excel. See the online help file in pipelinestudio for more information on working with pipelinestudio from the command line.
3. 2. Addition of fluid data in Import/Export of Initial Data Data for supply fluids is now exported with initial data export. When importing initial data for fluids, only the currently used properties for existing fluids can be altered i.e. for a compositional fluid, only the fraction of a constituent component can be altered.
8
Gas Network Training 4. PipelineStudio import and export file formats The main file type used for import and export by pipelinestudio is the comma separated value (CSV) file. This file has the format:
Data 1, Data 2, Data3 The comma indicates a field separator. There are several different import and export options available for pipelinestudio. These options are: Import/Export Keyword file – The file format describes the configuration of the pipeline network to be studied in a formatted paragraph file. It is used primarily for processing purpose though some older configurations may be stored in this file format. Initial data – This file format describes the pipeline configuration in terms of a CSV file. This file is used to import boundary condition changes into pipelinestudio. The file does not have to contain a full description of the network, only the parts which should be changed. Scenario data – This file describes a transient scenario in terms of a CSV file which may be exported into pipelinestudio. Options data – This file describes the simulation options in a CSV file format. Not all options may be changed with this file. Library file – An archived library may be imported. The file is in a binary file format. The files which are normally used for an integrated pipelinestudio application are the Initial Data file, the Scenario file and perhaps the Options file. The initial data is normally used to describe any steady set point and constraint changes to the defaults configuration, the scenario file describes any changes to the default transient scenario and the options file may describe any changes to the base options.
9
Gas Network Training 5. Creating simple VBA macros Visual Basic for Applications is Microsoft’s common application programming language. This is often called a macro language. A macro is a series of instructions designed to simplify repetitive tasks within a program. VBA shares some commonality with Visual Basic, particularly in its syntax, however it is designed specifically to drive features of a software package, not create a software package in its own right. This program uses VBA for Excel as the programming resource, and this section is intended to develop some basic knowledge of the VBA language to allow us at the end of the session to put together a complete application. Whilst no attempt is made to “teach” how to or inform of every feature in VBA it is concentrated on developing applications for end users who are not experts and predicated on design from the top done but implementation from the bottom up approach. Essentially VBA may be considered as a true programming language with a few distinctions from stand alone Visual Basic, the main one being that VBA cannot be executed outside of it’s parent application (in this case Microsoft Excel). VBA is a way to write Windows code without having to consider jargon such as API’s and threads, thereby simplifying the development process. It is also a way to use Excel as a formatting and layout tool so that coding effort is expended on getting the job done not building the graphical user interface. There are two ways to create VBA macros for Excel. Familiarity with both is advantageous. The primary way, and the way most advanced Excel users are familiar with, is to create a macro using the macro record function. Selecting this function permits a set of repetitive functions to be undertaken in Excel (such as complex formatting to make an imported file type more readable and usable). A user can then play this function back at any time required by selecting the function from the available macros. The second way of macro editing is to edit the code in the Visual Basic Editor. This may be accessed from the menu options or by using “Alt-F11”. The Visual Basic Editor is a development environment which provides the user with access to projects, functions and code contained within an Excel worksheet (though access to this can be password protected if required). During this program both methods may be used at various times, however as editing code is a priority this is the first area that should be concentrated on. Initiate a Microsoft Excel session and enter the Microsoft Visual Basic editor (either from Tools | Macro | Visual Basic Editor; or by using Alt-F11). When programming it is often the case that you rely on other external resources. Additional resources to the standard Excel VBA resources may be loaded from the Tools | References option, however for this program the standard resources should be sufficient. Code may be created by simply developing a new macro function and typing the code in. To create the macro function you may simply double click on “Sheet 1” in the VBA Project tree, which will initiate a new macro. Cells within an Excel worksheet, and the worksheet itself, are “objects” to manipulate. Some code may be created, thus, to populate some cells with some values:
10
Gas Network Training
Option Explicit Public Sub fill_some_cells() Worksheets(“Sheet1”).Range(“A2:C7”).Value = “Hi!” End Sub This macro may then be run, using the play button from the Visual Basic editor. So what this piece of code does is: Option Explicit
Forces explicit declaration of all variables
Public Sub fill_some_cells()
Creates a subroutine called fill_some_cells
Worksheets(“Sheet1”).Range(“A2:C7”).Value=”Hi!”
Selects worksheet Sheet1, selects the cells in the range A2 to C7 and populates these cells with the value Hi.
End Sub
Closes the sub routine
5.1. VBA Example 1 Write a macro which populates cells A2 to C7 with the value “Hi!” and then pauses for 10 seconds. Continue developing the macro such that then clears cells A2 to C7, and fills cells A1 to A9 with values 1 to 9. Perform a calculation on the cells on B1 to B9 which uses the values from A1 to A9; the calculation should be B x=Ax*Ax. Finally in the cells C1 to C9, take the value from B1 to B9 and take the cube root of the value. Format the cells such that they are RED if the value in the C column is greater than 3. HINT: the hard work can often be done by using the record function to right a lot of a macro for you. All you need to do then is take the code created and implement it in your new macro. File handling may be performed using VBA as well. You can: Open a text file Write to a text file Delete a file Open a file for writing the command
6. Case Study: Using Microsoft Excel to automate an integrated PipelineStudio system
11
Gas Network Training An integrated system where pipelinestudio is used as a component requires the following: pipelinestudio A FIXED pipelinestudio network configuration file A parent application which can: - Generate a Setpoint file - Generate a Scenario file - Generate a Batch file from which to drive pipelinestudio - Has the ability to execute the batch file from the parent application - Has the ability to read data from text files and format to user requirements With the application to be developed the following tasks should be performed:
Generate set point data Execute batch file Set point file
pipelinestudio Generate data
scenario
Scenario file
Import trend file
Generate batch file
Develop a trend plot using Excel
Batch file
The code to perform this set of functions is relatively straightforward, selecting data from an Excel worksheet, copying the data in a file (one for set points and one for the scenario); creating a
12
Gas Network Training batch file which run steady-state and transient pipelinestudio simulations using the set point and scenario data that has been created; and finally importing the output trend file into Excel and presenting a trend plot.
13
Gas Network Training 7. Example Macro Code The following section of macro is an example of how the application may be implemented. Option Explicit ' Declaring public means the macro will be available to any other spreadsheets, ' private means it can only be used in this spreadsheet
Public Sub CreateSetpointFile() 'With VBA you need to declare an variables you use in a macro
Dim FileNum As Integer Dim sSetpointFileNameWithPath As String ' This piece of code creates the setpoint file in the correct location
sSetpointFileNameWithPath = ThisWorkbook.Path & "\" & "setpoint.csv" ' This line makes it a little easier to work with files, we are assigning a free file number ' to the variable FileNum
FileNum = FreeFile ' This line permits us to allow read/write access to the setpoints file
Open sSetpointFileNameWithPath For Output Access Write As #FileNum Close #FileNum ' This section of code copies data from the workbook to the setpoint file
Worksheets("Setpoints").Activate Worksheets("Setpoints").UsedRange.Select Selection.Copy Workbooks.Open Filename:=sSetpointFileNameWithPath Selection.PasteSpecial Paste:=xlValues, operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveWorkbook.SaveAs Filename:=sSetpointFileNameWithPath _ , FileFormat:=xlCSV, CreateBackup:=False End Sub Public Sub CreateScenarioFile() Dim FileNum As Integer Dim sScenarioFileNameWithPath As String sScenarioFileNameWithPath = ThisWorkbook.Path & "\" & "scenario.csv" FileNum = FreeFile Open sScenarioFileNameWithPath For Output Access Write As #FileNum Close #FileNum
14
Gas Network Training
Worksheets("Scenario").Activate Worksheets("Scenario").UsedRange.Select Selection.Copy Workbooks.Open Filename:=sScenarioFileNameWithPath Selection.PasteSpecial Paste:=xlValues, operation:=xlNone, SkipBlanks:= _ False, Transpose:=False ActiveWorkbook.SaveAs Filename:=sScenarioFileNameWithPath _ , FileFormat:=xlCSV, CreateBackup:=False End Sub
Public Sub CreateBatchFileAndRun() Dim FileNum As Integer Dim sBatchFileWithPath, sStudioCommand, sStudioPath, sPLSID As String ' Here we create the batch file
sBatchFileWithPath = ThisWorkbook.Path & "\" & "pls.bat" FileNum = FreeFile ' This is the command we use to run pipelinestudio, note in this case we are using a direct path to each file
sStudioCommand = "cmd /k Start Plstudio /importdata " & ThisWorkbook.Path & "\setpoints.csv /scenariodata " & ThisWorkbook.Path & "\scenario.csv /StartMinimized /CloseWhenFinished /RunTransient " & ThisWorkbook.Path & "\Simulation_base.tgw" Open sBatchFileWithPath For Output As #FileNum Write #FileNum, sStudioCommand Close #FileNum ' This piece of code runs the batch file
sPLSID = (ThisWorkbook.Path & "\pls.bat") On Error Resume Next AppActivate (Shell(sPLSID)) End Sub
15
Gas Network Training
Public Sub ImportWTGFile() ' This code opens the WTG file, copies the data and pastes it inot our worksheet
Workbooks.OpenText Filename:=ThisWorkbook.Path & "\" & "Simulation_Base.wtg" Workbooks("Simulation_Base.wtg").Worksheets("Simulation_Base").Activate Workbooks("Simulation_Base.wtg").Worksheets("Simulation_Base").UsedRange.Select Selection.Copy Workbooks("Application.xls").Worksheets("Results").Activate ActiveWorkbook.Worksheets("Results").Range("A1").Select ActiveWorkbook.Worksheets("Results").Paste End Sub Public Sub GraphInventory() ' This code creates a graph of inventory
Workbooks("Application.xls").Worksheets("Results").Activate ActiveWindow.SmallScroll ToRight:=137 Range("ER1").Select ActiveCell.FormulaR1C1 = "Inv Sum" Range("ER7").Select ActiveCell.FormulaR1C1 = "MMSCF" Range("ER8").Select ActiveCell.FormulaR1C1 = _ "=SUM(RC[-140]+RC[-133]+RC[-126]+RC[-119]+RC[-112]+RC[-105]+RC[-98]+RC[-91]+RC[84]+RC[-77]+RC[-70]+RC[-63]+RC[-56]+RC[-49]+RC[-42]+RC[-35]+RC[-28]+RC[-21]+RC[14]+RC[-7])" Range("ER8").Select Selection.AutoFill Destination:=Range("ER8:ER68"), Type:=xlFillDefault Range("ER8:ER68").Select Charts.Add ActiveChart.ChartType = xlXYScatterSmoothNoMarkers ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Inventory" With ActiveChart .HasTitle = True .ChartTitle.Characters.Text = "Inventory Vs Time" .Axes(xlCategory, xlPrimary).HasTitle = True .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Time" .Axes(xlValue, xlPrimary).HasTitle = True .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Inventory" End With ActiveChart.HasLegend = False Application.CommandBars("Chart").Visible = False End Sub
16
View more...
Comments