+ Reply to Thread
Results 1 to 2 of 2

Run Workbooks.OpenText from Word

  1. #1
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Run Workbooks.OpenText from Word

    I am creating documentation that we use to run daily tasks and I am trying to automate some of it. Part of the process we need to import a few text files into excel then save them after a few modifications into another folder. I coded it first in excel, now I am moving it into Word and this is the code I have:

    Please Login or Register  to view this content.
    It looks correct but I keep receiving a compile error on the Worksbooks.OpenText line that says "Expected Function or Variable." That works in Excel. I even tried Excel.Workbooks.OpenText and xl.Workbooks.OpenText. I already set a Reference to the Excel Object model in the References section. What am I missing here?
    Last edited by djblois1; 05-13-2022 at 03:59 PM.

  2. #2
    Forum Contributor
    Join Date
    08-23-2010
    Location
    Staten Island, NY
    MS-Off Ver
    Excel 2003
    Posts
    242

    Re: Run Workbooks.OpenText from Word

    I found the issue here: https://www.excelforum.com/excel-pro...ext-error.html

    I thought it pertained to word but it doesn't. It pertains to how I was setting the workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Workbooks.OpenText parses out spaces?
    By Oppressed1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2019, 01:30 PM
  2. [SOLVED] Workbooks.OpenText Error
    By sperry2565 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-25-2013, 04:03 PM
  3. Workbooks.OpenText Fieldinfo
    By Peterppp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2007, 05:33 AM
  4. Workbooks.Opentext - oldskool '97
    By bradsalmon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2006, 10:50 AM
  5. Workbooks.OpenText problem in XL2000
    By Mike Iacovou in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2006, 01:15 PM
  6. [SOLVED] Workbooks.OpenText StartRow:=2 Not Skipping Row 1
    By John Saunders in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2005, 07:05 AM
  7. [SOLVED] Workbooks.OpenText does not work on XP. HELP !!!
    By richmarin@earthlink.net in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-31-2005, 11:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1