+ Reply to Thread
Results 1 to 2 of 2

Passing Workbook between two subroutines

  1. #1
    Forum Contributor
    Join Date
    03-05-2015
    Location
    norwich
    MS-Off Ver
    365
    Posts
    104

    Passing Workbook between two subroutines

    Hi,

    I have code which imports data from one sheet to another. I name them through the code by the following

    HTML Code: 
    Dim DestWB As Workbook: Set DestWB = ActiveWorkbook
    Then

    HTML Code: 
     Workbooks.OpenText Filename:=Project_Path _
            , Origin:=65001, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _
            xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, Semicolon:=False, _
            Comma:=True, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), _
            Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), Array(8, 1), _
            Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1)), TrailingMinusNumbers:=True
    
    
    Set SrcWB = ActiveWorkbook
    So I can call each wookbook when required using

    DestWB
    SrcWB

    My question is, how on earth can I use these names in another subroutine. I've been looking for hours and can't get my head around it. I've tried passing it using the blow but it doesn't work. I'm really lost here so any help would be appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    1,691

    Re: Passing Workbook between two subroutines

    ?
    Please Login or Register  to view this content.
    ?

+ 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. Passing 2-dimensional arrays between subroutines
    By Pak Mariman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2018, 01:34 AM
  2. Passing variables back and forth between subroutines
    By beachbum2015 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2015, 11:50 AM
  3. [SOLVED] can't debug some subroutines in my project, locked subroutines
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-28-2012, 01:16 PM
  4. Passing Variables out of Subroutines
    By cmcconnehey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-24-2007, 08:20 PM
  5. Calling subroutines and passing variables
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2006, 11:25 AM
  6. Calling subroutines and passing variables
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2006, 10:55 AM
  7. Replies: 2
    Last Post: 01-19-2006, 06:00 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