% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/class-workbook-wrappers.R
\name{wb_workbook}
\alias{wb_workbook}
\title{Create a new Workbook object}
\usage{
wb_workbook(
  creator = NULL,
  title = NULL,
  subject = NULL,
  category = NULL,
  datetime_created = Sys.time(),
  datetime_modified = NULL,
  theme = NULL,
  keywords = NULL,
  comments = NULL,
  manager = NULL,
  company = NULL,
  ...
)
}
\arguments{
\item{creator}{Creator of the workbook (your name). Defaults to login username or \code{options("openxlsx2.creator")} if set.}

\item{title, subject, category, keywords, comments, manager, company}{Workbook property, a string.}

\item{datetime_created}{The time of the workbook is created}

\item{datetime_modified}{The time of the workbook was last modified}

\item{theme}{Optional theme identified by string or number.
See \strong{Details} for options.}

\item{...}{additional arguments}
}
\value{
A \code{wbWorkbook} object
}
\description{
This function initializes and returns a \link{wbWorkbook} object,
which is the core structure for building and modifying openxml files
(\code{.xlsx}) in \code{openxlsx2}.
}
\details{
You can define various metadata properties at creation, such as the
\code{creator}, \code{title}, \code{subject}, and timestamps. You can also
specify a workbook theme.

The returned \code{\link[=wb_workbook]{wb_workbook()}} object is an \code{\link[R6:R6Class]{R6::R6Class()}} instance.
Once created, the standard workflow is to immediately add a worksheet
using \code{\link[=wb_add_worksheet]{wb_add_worksheet()}}. From there, you can populate the sheet with data
(\code{\link[=wb_add_data]{wb_add_data()}}), or formulas (\code{\link[=wb_add_formula]{wb_add_formula()}}), and apply styling
or other elements.

\code{theme} can be one of
"Atlas", "Badge", "Berlin", "Celestial", "Crop", "Depth", "Droplet",
"Facet", "Feathered", "Gallery", "Headlines", "Integral", "Ion",
"Ion Boardroom", "LibreOffice", "Madison", "Main Event", "Mesh",
"Office 2007 - 2010 Theme", "Office 2013 - 2022 Theme", "Office Theme",
"Old Office Theme", "Organic", "Parallax", "Parcel", "Retrospect",
"Savon", "Slice", "Vapor Trail", "View", "Wisp", "Wood Type"
}
\examples{
## Create a new workbook
wb <- wb_workbook()

## Set Workbook properties
wb <- wb_workbook(
  creator  = "Me",
  title    = "Expense Report",
  subject  = "Expense Report - 2022 Q1",
  category = "sales"
)

## Cloning a workbook
wb1 <- wb_workbook()
wb2 <- wb1$clone(deep = TRUE)
}
\seealso{
Other workbook wrappers: 
\code{\link{base_font-wb}},
\code{\link{col_widths-wb}},
\code{\link{creators-wb}},
\code{\link{grouping-wb}},
\code{\link{row_heights-wb}},
\code{\link{wb_add_chartsheet}()},
\code{\link{wb_add_data}()},
\code{\link{wb_add_data_table}()},
\code{\link{wb_add_formula}()},
\code{\link{wb_add_hyperlink}()},
\code{\link{wb_add_pivot_table}()},
\code{\link{wb_add_slicer}()},
\code{\link{wb_add_worksheet}()},
\code{\link{wb_base_colors}},
\code{\link{wb_clone_worksheet}()},
\code{\link{wb_copy_cells}()},
\code{\link{wb_freeze_pane}()},
\code{\link{wb_merge_cells}()},
\code{\link{wb_save}()},
\code{\link{wb_set_last_modified_by}()}
}
\concept{workbook wrappers}
