Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2014, 07:16 PM
buncs buncs is offline Problem opening Workbook with WORD VBA Windows 7 32bit Problem opening Workbook with WORD VBA Office 2010 32bit
Novice
Problem opening Workbook with WORD VBA
 
Join Date: Jan 2014
Posts: 1
buncs is on a distinguished road
Default 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.
Reply With Quote
Reply



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 Workbook with WORD VBA Problem opening Word 2003 Julie C Word 4 09-25-2012 03:36 AM
Problem opening Workbook with WORD VBA #REF! error when opening a workbook that contain a refference to another workbook tanababa Excel 2 06-07-2012 03:11 PM
Problem opening Workbook with WORD VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft