Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
[email protected] expressplanweb2@gmail.com is offline
external usenet poster
 
Posts: 2
Default Excel 2003 as DataSource problem

I walked through the MS training of the mail merge process on how to
use the toolbar, and it seemed (and originally was) pretty straight-
forward. My actual objective was to create a way to merge ONE row of
Excel data (not mailing fields but custom fields) with ONE Word
document, via a macro. I needed to do it manually before I could
record the macro. The idea was I could pick a row, copy it into my
DataSource Sheet2$ and then execute my macro in Word.

I went through the toolbar, left to right. Set the document type as
NORMAL, connected to the DataSource, choosing the Sheet2$ of the
spreadsheet as the actual DataSource, added my fields, clicked Merge
to New Document, and it worked as advertised. So far so good. So I
recorded this macro in Word:


Sub Grabbitt()
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With
Selection.WholeStory
Selection.Copy
End Sub

Pretty simple, right? The macro worked the first time, but when I
copied a new row into Sheet2$ and saved the Excel sheet, re-executing
the macro did not pick up the new row. I assumed that was because no
re-querying of the DataSource took place. So I looked around with the
Object Browser to find a method of the DataSource object that would
refresh its query; to no avail. I want to avoid closing and opening
the Merge Document, because that entails too much time and turns my
time-saving macro into a time waster.

What should I do? That's the first question. Please, if time permits,
read on...

Problem 2 occurred after I tried to reopen all the documents after a
restart on my system. This time, upon trying to reopen the Merge
Document, it reported it could not locate its DataSource. Nothing had
moved. I tried detaching the DataSource (one of the options in the
error dialog for the "could not locate" error). Now, upon attempting
to reattach, I navigated to the spreadsheet, chose Sheet2$, but now it
wants me to SELECT TABLE, off of a blank ListBox. (nothing to Select).
So now, I cannot get my DataSource reattached. It never presented that
dialog the first time around. What causes this and how do I get past
it and reselect my DataSource, and why couldn't it find it in the
first place?

Any help on these two related issues would be greatly appreciated.
It's all Office 2003 Professional SP3


 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge and Excel Datasource Erika Mailmerge 1 November 23rd 06 05:35 PM
Mailmerge from Excel Datasource Jan Mailmerge 1 March 21st 06 07:39 PM
Editing an Excel DataSource Sue Hughes Mailmerge 1 January 5th 06 10:54 AM
Excel datasource [email protected] Mailmerge 1 November 14th 05 08:10 PM
Problem with repeated access to the datasource (Excel Spreadsheet) Mike C. Mailmerge 6 July 20th 05 11:01 AM


All times are GMT +1. The time now is 09:34 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"