Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-23-2012, 01:31 PM
Joe Patrick Joe Patrick is offline Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Windows 7 64bit Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Office 2007
Advanced Beginner
Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248
 
Join Date: May 2011
Posts: 33
Joe Patrick is on a distinguished road
Default Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248

Hi,

Can anyone tell me why this is not working? I get "runtime error 4248 - because no document is open" on the 'with activedocument" line although it is open and visible.

Thank you!



Code:
 
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "\\Toolbox\bulletinboard\EIP_template.doc"
 
With ActiveDocument
.TextBox1.Value = ThisWorkbook.Sheets("SDF & ER").Range("A13").Value
.TextBox2.Value = ThisWorkbook.Sheets("SDF & ER").Range("J7").Value
.TextBox3.Value = ThisWorkbook.Sheets("SDF & ER").Range("A10").Value
.TextBox4.Value = ThisWorkbook.Sheets("SDF & ER").Range("A16").Value
.TextBox5.Value = ThisWorkbook.Sheets("SDF & ER").Range("C16").Value
.TextBox6.Value = ThisWorkbook.Sheets("SDF & ER").Range("A19").Value
.TextBox7.Value = ThisWorkbook.Sheets("SDF & ER").Range("A25").Value
.TextBox8.Value = ThisWorkbook.Sheets("SDF & ER").Range("A58").Value
.TextBox9.Value = ThisWorkbook.Sheets("SDF & ER").Range("B7").Value
.TextBox10.Value = ThisWorkbook.Sheets("SDF & ER").Range("E7").Value
.TextBox11.Value = ThisWorkbook.Sheets("SDF & ER").Range("A28").Value
.TextBox12.Value = ThisWorkbook.Sheets("SDF & ER").Range("B30").Value
.TextBox13.Value = ThisWorkbook.Sheets("SDF & ER").Range("C64").Value
.TextBox14.Value = ThisWorkbook.Sheets("SDF & ER").Range("H55").Value
.TextBox15.Value = ThisWorkbook.Sheets("SDF & ER").Range("A22").Value
.TextBox16.Value = ThisWorkbook.Sheets("SDF & ER").Range("G7").Value
.SaveAs Filename:="\\Toolbox\bulletinboard\" & ThisWorkbook.Sheets("SDF & ER").Range("J7").Value & ".htm", FileFormat:=wdFormatHTML
End With
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Runtime Error 4120 in Word 2007 macro Frankwlc Word 5 11-28-2011 01:54 AM
Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Merge excel info into word letter. curatorfm Mail Merge 1 03-20-2011 04:26 AM
Word Fill-in form with Excel spreadsheet karik Word 0 01-11-2010 08:45 AM
Runtime error 5487 - Word cannot complete the save to to file permission error franferns Word 0 11-25-2009 05:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:27 AM.


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