WorkbookNew_ANmar

Creates new workbook (does not save it) and returns filename.

Function WorkbookNew_ANmar()
' creates a new workbook and returns its name
secScreen = Application.ScreenUpdating
Application.ScreenUpdating = False
Workbooks.Add
WorkbookNew_ANmar = ActiveWorkbook.Name
Application.ScreenUpdating = secScreen
ThisWorkbook.Activate
End Function

Examples

wknam = WorkbookNew_ANmar(&#34;Data&#34;)<br/>wknam = WorkbookNew_ANmar(&#34;New.csv&#34;, , 1)<br/>If WorkbookNew_ANmar(&#34;expenses.csv&#34;, 0) = &#34;&#34; Then msgbox &#34;Please close file before continue&#34;

Views 51 Downloads 16

Perm link