6 Replies - 1300 Views - Last Post: 27 June 2014 - 01:05 PM Rate Topic: -----

#1 NickHallick  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-May 14

Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 11:36 AM

As part of a program i am working on data is transferred into an excel document with usually more than one worksheet. after that happens a mail merge is manually done to create labels. the problem i am having is that the first time i open the excel workbook i can choose a table and make labels fine but if i try to open the excel workbook again to change the table to make new labels an error pops up saying that word cannot open the data file because it is already open. i know for a fact that the only place it is open is in word because i already have labels open from it, and this operation works perfectly fine on another computer. i am concluding that this is a Microsoft office error however i cant find any other people having problems with this.

Is This A Good Question/Topic? 0
  • +

Replies To: Error when changing excel data sheets in word mail merge?

#2 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3808
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 11:43 AM

Where are you building your program? C#/VB.NET? From Excel, or Word?

Also post some relevant code.

Quote

i am concluding that this is a Microsoft office error

That is a bold conclusion, and usually wrong.

This post has been edited by andrewsw: 27 June 2014 - 11:44 AM

Was This Post Helpful? 0
  • +
  • -

#3 NickHallick  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-May 14

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 11:47 AM

the program that transfers information to the excel sheet is made in vb6 code. but the mail merge action is purely user driven in word taking data from the excl workbook created through the vb6 program. so the problem i am having is not code automated it is a manual operation.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3808
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 12:03 PM

Please clarify because, from your description, it appears that you are attempting to open and modify the Excel file while you are already in Word performing a mail-merge.

I wouldn't do that, and have known it to be problematic in the past. If you have Word open I would close Word, change the data in Excel, exit Excel, and then re-start Word.
Was This Post Helpful? 0
  • +
  • -

#5 NickHallick  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-May 14

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 12:11 PM

there is no modification of the excel file after the initial input of information from the program. what im having trouble with is when the excel workbook is closed i go to the "SELECT RECIPIENTS" tab and then "USE AN EXISTING LIST". at this point there is already labels in the word document i just want to change the table that it is pulling information from. but when i go to the excel sheet and click on it it gives me the error where it says it is already open. to clarify, i dont want to modify the excel sheet(s) i just want to get the information from it.
Was This Post Helpful? 0
  • +
  • -

#6 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3808
  • View blog
  • Posts: 13,508
  • Joined: 12-December 12

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 12:47 PM

Quote

is when the excel workbook is closed..

I am having to read between the lines here because your description remains unclear to me. (For example, does your VB6 code leave the Excel file open? And do you then close the workbook, or exit Excel?)

My guess is that your VB6 code isn't correctly disposing of all the Excel references.

This post has been edited by andrewsw: 27 June 2014 - 12:48 PM

Was This Post Helpful? 0
  • +
  • -

#7 NickHallick  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 13-May 14

Re: Error when changing excel data sheets in word mail merge?

Posted 27 June 2014 - 01:05 PM

sorry for being unclear im trying to be as clear as possible! yes the excel program is opened by the code and yes it is closed afterwards (only open to verify contents). this action of making labels is working correctly with the vb6 program on other computers however not on this one. i dont beleive it is a problem with the code but a problem with word or excel itself.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1