Copying Word to Excel using paragraph-copy macro in OfficeXP - help needed
投稿者: DZiW (X)
DZiW (X)
DZiW (X)
ウクライナ
英語 から ロシア語
+ ...
Apr 28, 2009

Hi coders.

Recently I wanted to automate the routine of copying from Word to Excel using this paragraph-copy macro:
Code:
Public Sub ParagraphIterator()
Dim myXL As excel.Application 'err is here !!!
excel.Application
Dim iParagraph As Paragraph
Dim iCounter As Long

Set myXL = New excel.Application
my... See more
Hi coders.

Recently I wanted to automate the routine of copying from Word to Excel using this paragraph-copy macro:
Code:
Public Sub ParagraphIterator()
Dim myXL As excel.Application 'err is here !!!
excel.Application
Dim iParagraph As Paragraph
Dim iCounter As Long

Set myXL = New excel.Application
myXL.Workbooks.Add
iCounter = 0

For Each iParagraph In ActiveDocument.Paragraphs
iCounter = iCounter + 1
myXL.ActiveWorkbook.Worksheets(1).Range("A" & iCounter).Value = iParagraph.Range.Text
Next iParagraph

myXL.ActiveWorkbook.SaveAs "c:\Test.xls"
myXL.Quit
Set myXL = Nothing
End Sub



The problem is it WAS working fine, but in OfficeXP it says to the very first declaration:
Dim myXL As excel.Application
User-defined type not defined

I was going to rework it to copy every single word, but even this version is no go.
How I wish I could remember this fine nuance...
Could somebody who knows help me please?
TIA

[Subject edited by staff or moderator 2009-04-28 13:41 GMT]
Collapse


 
Frederic Lievre
Frederic Lievre
アイルランド
Local time: 04:10
英語 から フランス語
+ ...
Have you tried the following.... Apr 28, 2009

Dim myXL As Excel.Application
Set myXL = CreateObject("Excel.Application")

Hope this help


 
SysfilterMaker
SysfilterMaker
ドイツ
Local time: 05:10
A reference to the Excel Library is required Apr 28, 2009

Hi,

First add the Excel Library (Microsoft Excel 11.0 Object Library) to your project.

(Menu -> Tools-> References)

Then you can go on....

Mit freundlichen Grüßen / Kind regards

Wilhelm Polmann

www.sysfilter.com


 
DZiW (X)
DZiW (X)
ウクライナ
英語 から ロシア語
+ ...
TOPIC STARTER
*solved* thank you Apr 28, 2009

Merci beaucoup, Frederic! Danke schön, Wilhelm!
Vieillesse - tristesse. Alter ist ein schweres Malter.
Getting old is no too much fun, you know

I really did forget to make the reference to Excel first before calling its app type.

Cheers.


 


To report site rules violations or get help, contact a site moderator:

このフォーラムのモデレーター
Maya Gorgoshidze[Call to this topic]
Prachya Mruetusatorn[Call to this topic]

You can also contact site staff by submitting a support request »

Copying Word to Excel using paragraph-copy macro in OfficeXP - help needed






Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »



Forums
  • All of ProZ.com
  • 用語検索
  • 仕事
  • フォーラム
  • Multiple search