ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel automation and Shared Workbooks (https://www.excelbanter.com/excel-programming/324779-excel-automation-shared-workbooks.html)

VadimT

Excel automation and Shared Workbooks
 
Hello,
I have recently attempted to fix a problem with Excel processes not going
away when run through automation, by replacing calls to
Excel.Workbooks.Open(filename)
with
Excel.Workbooks.Add(filename)
I have now run into a problem using this code for a shared workbook, because
a "Save As..." dialog pops up when the call to Add is made.
Can anyone explain the fundamental differences between Add and Open methods
on the Workbooks object, and how that interacts with the sharing of a
Workbook?

Thanks.

keepITcool

Excel automation and Shared Workbooks
 



workbooks.add("c:\path\file.xls") creates a NEW (unsaved) workbook
based on the template specified by filename.

how do you want to share a workbook that hasn't been saved?


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


VadimT wrote :

Hello,
I have recently attempted to fix a problem with Excel processes not
going away when run through automation, by replacing calls to
Excel.Workbooks.Open(filename)
with
Excel.Workbooks.Add(filename)
I have now run into a problem using this code for a shared workbook,
because a "Save As..." dialog pops up when the call to Add is made.
Can anyone explain the fundamental differences between Add and Open
methods on the Workbooks object, and how that interacts with the
sharing of a Workbook?

Thanks.


Peter Huang [MSFT]

Excel automation and Shared Workbooks
 
Hi

I agree with keepITcool's suggestion.
We need to save the new created workbook first, so that we can share the
workbook.
If you still have any concern, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com