+ Reply to Thread
Results 1 to 11 of 11

Adapting VBA from Word to work in Excel

Hybrid View

  1. #1
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,730

    Re: Adapting VBA from Word to work in Excel

    My bad. I didn't read the code carefully enough. The code I provided is suitable for ThisWorkbook.Path. But you are using a local variable called Path that has the delimiter appended. (That is why I never use a variable name that is the same as a built-in object method.)

    Anyway, for your code, the correct line of code is, as you say:

       Workbooks.Open Filename:=Path & DirN
    I am guessing you have already tried it by now and found it works.

  2. #2
    Registered User
    Join Date
    12-16-2013
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Adapting VBA from Word to work in Excel

    Thank you for your assistance. Workbooks.Open Filename:=Path & DirN should work but it is not. I am so perplexed by this. As I said im a total novice though i felt i was getting somewhere and this has stumped me all weekend.This part of the code works in Word, must be complicated to adapt to Excel.
    Is there a better way to achieve what Im after, Folder Browser> Run Macro on all .xls files in Selected Folder and SubFolders? Im must be wrong somewhere. So stumped. Again thank you for your input.

+ 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. Open Word Work Order Template with excel generated work order #
    By Tivka in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-26-2012, 02:24 PM
  2. Get excel to work with Word?
    By Niffe783 in forum Excel General
    Replies: 1
    Last Post: 02-10-2011, 11:06 AM
  3. Adapting Bubblesort to work with Long datatype array
    By Jeroen1000 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-30-2009, 08:26 AM
  4. Getting Word to work with Excel
    By mike.wasson@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2006, 08:20 AM
  5. Replies: 1
    Last Post: 02-18-2005, 11:06 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