Results 1 to 9 of 9

Passing a private variable to another module

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Passing a private variable to another module

    I have some code in which I need to pass the value of "j" from one module to another. "j" is declared in Sheet1 (Data) under the Microsoft Excel Objects.

    Option Explicit
    
    Private Sub CommandButton1_Click()
    
        Dim i As Long
        Dim j As Integer
        Dim lastrow As Integer
    I need to pass the value of j to a class module which is coded as follows:
    Option Explicit
    
    Private pWinHttpRequest As WinHttp.WinHttpRequest
    
    Friend Function GetHistoricalData(Symbol As String, _
        Optional FromDate As Date = #12:00:00 AM#, _
        Optional ToDate As Date = #12:00:00 AM#, _
        Optional Interval As String = "Daily") As ADODB.Recordset
        
        Dim URL As String, ResponseText As String
        Dim pRecordSet As ADODB.Recordset
        Dim DateString As String, IntervalString As String
        Dim RTS() As String, RTFI
        Dim x As Long
    .

    I have tried a number of different options such declaring "j" has a Public Variable and trying pass "j" ByVal but can't get any of these options to work. Not sure what I am doing wrong. Thanks.
    Last edited by maacmaac; 11-26-2008 at 02:27 PM.

Thread Information

Users Browsing this Thread

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

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