Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2014, 02:06 PM
jon12355 jon12355 is offline Excel to Word and delete certain tables Windows 7 64bit Excel to Word and delete certain tables Office 2007
Novice
Excel to Word and delete certain tables
 
Join Date: Oct 2014
Posts: 5
jon12355 is on a distinguished road
Default

I have tried to use your code on my spreadsheet but I cant get it to work

For the first part of the code I have put

Code:
Dim AppWord As Object
Dim oDoc As Object
Dim oTbl As Object
Dim oRng As Object
Dim lngIndex As Long, lngObjectives As Long
  On Error Resume Next
  Set AppWord = GetObject(, "Word.Application")
  If Err Then
      Set AppWord = CreateObject("Word.Application")
  End If
  AppWord.Visible = True
  On Error GoTo 0
  Set oDoc = AppWord.Documents.Add("Pathway to template document")

  Set oTbl = oDoc.Tables(8)
  With oTbl
    .Cell(2, 2).Range.Text = combo_Obj1_Reg.Text
    .Cell(3, 2).Range.Text = combo_Obj1_RegC.Text
    .Cell(4, 2).Range.Text = txt_Obj1Nar.Text
    .Cell(5, 2).Range.Text = txt_Obj1Sum.Text
    .Cell(6, 2).Range.Text = txt_Obj1_irr.Text
    .Cell(7, 2).Range.Text = txt_Obj1_Post.Text
    .Cell(8, 2).Range.Text = txt_Obj1_Att1.Text
    .Cell(9, 2).Range.Text = txt_Obj1_Att2.Text
    .Cell(10, 2).Range.Text = txt_Obj1_Att3.Text
  End With
In your example it looks like the next part of the code refers to coloumns, how to I write it for text and comboboxes? In the above code all the naming is the same expect obj1 is obj2.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Word and delete certain tables Blury Excel Tables in Word zachg18 Word 1 07-15-2013 11:10 PM
how to copy all ms word tables into excel rehan129 Word 0 01-28-2012 10:17 AM
Excel to Word and delete certain tables Excel Tables to MS Word ripcurlksm Word Tables 2 09-09-2011 04:59 AM
Excel to Word and delete certain tables using checkboxes to delete tables atfresh Word Tables 1 06-19-2011 09:13 PM
Excel to Word and delete certain tables working with excel tables in MS word radman154 Word Tables 1 03-25-2011 12:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:44 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