LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 113
Default Pulling in Data from Word

Okay, so I figured out how to do it, and it works pretty nicely, but I'd still be glad to hear of any possible improvements. One thing I couldn't figure out how to do was make Excel the active applicaton again after having opened the word document. I want Excel to be the application on screen while the macro is running. The only solution I could come up with was setting word visible = false. Any way to just "activate" excel

Public Sub test(

Dim wd As Objec
Dim tempvar As Strin
Dim xlapp As Excel.Applicatio
Dim wdAPP As Word.Applicatio
Dim wdDoc As Word.Documen
Dim response As VbMsgBoxResul
Set xlapp = Excel.Applicatio
sRNM = Application.GetOpenFilename("Word Files (*.doc), *.doc"
If sRNM = False The
GoTo e
End I
' With Dialogs(xlDialogFileOpen
' If .Display The
' sRNM = WordBasic.FilenameInfo$(.Name, 1
' End I
' End Wit

Set wdAPP = CreateObject("Word.Application"
Set wdDoc = wdAPP.Documents.Open(sRNM

wdAPP.Visible = Fals


For i = 2 To 100
xlapp.Goto Reference:=Rows(i).Columns("B"
tempvar = Application.Selectio
With wdAPP.Selection.Fin
.ClearFormattin
.MatchWildcards = Fals
.MatchCase = Tru
.Forward = Tru
.Wrap = wdFindContinu
.Text = tempva
.Execut
End Wit
If wdAPP.Selection.Find.found = True The
With wdAPP.Selectio
.MoveLeft unit:=wdCell, Count:=
.selectcel
.Cop
End Wit
xlapp.Goto Reference:=Rows(i).Columns("A"
tempvar2 = Application.Selectio
If tempvar2 < "" The
response = MsgBox("There is already an ID here! Continue Running?", vbYesNo
If response = vbNo The
wdAPP.Quit savechanges = Fals
GoTo e
End I
Els
xlapp.ActiveSheet.Paste Destination:=Rows(i).Columns("A"
End I
End I
Nex
wdAPP.Visible = Tru
wdAPP.Quit savechanges = Fals
Set wdAPP = Nothin
Set wdDoc = Nothin
es
End Su

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling information from Word to populate into Excel Melanie Tatasciore Excel Discussion (Misc queries) 1 October 9th 09 07:09 PM
Pulling data from other wb based on data to populate dropdown list Suzann Excel Discussion (Misc queries) 0 April 23rd 09 04:29 PM
Pulling a word from text out of a cell Ravens Fan Excel Discussion (Misc queries) 11 February 1st 08 03:03 AM
Tying to extract all data from a pivot pulling from external data Ted Urban Excel Discussion (Misc queries) 3 September 14th 07 10:50 AM
Linking two spreadsheet, pulling data from one cell to another, data is being truncated Ben Excel Worksheet Functions 0 September 13th 07 11:41 PM


All times are GMT +1. The time now is 02:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"