Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Jason Perry   on Oct 07 In MS Office Category.

  
Question Answered By: Madison Campbell   on Oct 07

The New works fine on my Project 2002 / Excel 2003 mix. However, an answer
on the Experts Exchange suggests you try replacing the New line with

Set xlApp = CreateObject("Excel.Application")

and that appeared to fix the person's problem.

The person later had further portability problems and the following code
fragment was offered as an alternative:

Sub CopyTableToExcel()
Dim tbl As Word.Table
Dim wdRow As Word.row
Dim wdCell As Word.Cell
Dim xlApp As Object ' Excel.Application
Dim xlWbk As Object ' Excel.Workbook
Dim xlWks As Object ' Excel.Worksheet
Dim r As Integer
Dim c As Integer
Const FirstRow = 1
Const FirstColumn = 1

Set xlApp = CreateObject("Excel.Application") ' New Excel.Application

This was for Excel driven from Word, but should apply to Project as well.
The changes from the original were the three "Object" lines and the
CreateObject statement. The thinking was that this worked better when there
were different versions of Excel involved.

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Compile Error Or get search suggestion and latest updates.


Tagged: