Start empty Excel workbook without any worksheets -


creating new excel workbook in:

dim xl excel.application dim wb excel.workbook set xl = new excel.application xl.visible = false set wb = xl.workbooks.add 

is there easy way stop excel automatically creating sheet1, sheet2, sheet3?

i can delete these unwanted sheets afterwards feels clunky solution.

xl.sheetsinnewworkbook = 1 

more information on msdn (scroll down add method applies workbooks object.)

full code:

dim xl excel.application dim wb excel.workbook dim restoresheetsinnewworkbook long  set xl =  new excel.application restoresheetsinnewworkbook = xl.sheetsinnewworkbook xl.sheetsinnewworkbook = 1  set wb = xl.workbooks.add xl.sheetsinnewworkbook = restoresheetsinnewworkbook 'or set 3' 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -