excel - Why does Workbooks.Open close default workbook? -
we developing excel plugin. have found issue visualbasic code fails when user runs after opening excel.
the code obtains workbook webservice , attempts insert sheet new workbook original workbook. fail when user has not interacted "default" workbook.
what mean "default" workbook created when excel starts, or press 'ctrl+n'.
the reason failure code:
workbooks.open (url)
shuts default workbook. why should be?
only default workbook shut. if had workbook open, above code not shut it.
we have tried work around issue storing reference active workbook.
set wkbmyworkbook = activeworkbook workbooks.open (url)
but after workbooks.open closes "default" workbook, reference variable still exists , has content.
what doing wrong? can help?
i don't have answer why happens, workaround idea, still happen if first write worksheet? example:
cells(1,1)="x" cells(1,1).clearcontents
Comments
Post a Comment