#1
|
|||
|
|||
Problem opening Workbook with WORD VBA
Hi My WORD 2010 document has been happily pulling data from an "open" Excel workbook during several weeks testing. The guy who is developing the workbook sent me his latest version and though it is the same xlsx working off 2010, I get a duplicate opening scenario. Here's the meat of the code: Dim objExcel As Excel.Application Dim exWb As Excel.Workbook ... ... Set objExcel = GetObject(, "Excel.Application") Set exWb = objExcel.Workbooks.Open(SelectionForm.Lst_WorkBook s) 'This sets the Workbook the user selected off the Form The SelectionForm.Lst_WorkBooks is the result of the user selecting a workbook from a list of currently open workbooks via the UserForm. Though this is an "Open" statement and the workbook was already open, it has worked perfectly while I was working with my colleagues previous workbook version. However, with his latest version, I get the message warning about reopening a workbook that is already open, which means from the user's aspect there is an interruption in the process of filling the details in WORD. I would have expected the warning, but why then did is work originally. Is there a better way of setting the selected workbook without using an "Open" statement. I'm all out of ideas. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem when opening documents in Word 2013 | lynnechapman | Word | 2 | 08-20-2013 05:33 AM |
Problem opening Word 2003 | Julie C | Word | 4 | 09-25-2012 03:36 AM |
#REF! error when opening a workbook that contain a refference to another workbook | tanababa | Excel | 2 | 06-07-2012 03:11 PM |
Problem opening second Word document | bTaryag | Word | 1 | 08-02-2011 02:48 PM |
Opening word document problem | SPARKY77 | Word | 4 | 11-02-2009 01:34 AM |