Results 1 to 9 of 9

Thread: Very Urgent....pls help (Resolved)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Posts
    100

    Very Urgent....pls help (Resolved)

    Hi,

    I hope someone would be able to help. Thanx

    I have got two excel files. "Test1.xsl" and "Test2.Excel". I have written the following code.

    Test1.xsl

    VB Code:
    1. Sub Product_Development()
    2.    Set wBook = Workbooks("Test2.xls")
    3.    wBook.Sheets("Sheet1").Activate
    4.    If wBook Is Nothing Then 'Not open
    5.            MsgBox "Workbook is not open", _
    6.            vbCritical, "OzGrid.com"
    7.            Set wBook = Nothing
    8.            On Error GoTo 0
    9.        Else 'It is open
    10.            MsgBox "Yes it is open", _
    11.            vbInformation, "OzGrid.com"
    12.            Set wBook = Nothing
    13.            On Error GoTo 0
    14.    End If
    15.    Range("A1").Select
    16.    ActiveCell.Offset(0, 0) = "Product Development"
    17.    'Dim frm As Object
    18.      
    19.    'Dim test
    20.    'frm.OpenNewLeadEntryForm
    21.    'MsgBox test
    22.      
    23. ' wBook.
    24.      
    25. ' open new initiative form in internal funnel
    26.  
    27. End Sub


    How do i call a functionshown below that is in "Test2.xsl" from the above code?

    VB Code:
    1. Sub OpenNewLeadEntryForm()
    2.    Application.ScreenUpdating = False
    3.    frmNewLeadEntry.Show
    4.    'cell = "Product Development"
    5. End Sub


    This is very urgent. I hope someone can help me. Thanx
    Last edited by sand; Jun 27th, 2005 at 09:01 PM.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Very Urgent....pls help

    Application.Run "test2.xls!Sheet1.OpenNewLeadEntryForm"

    change sheet1 to sheet no or thisworkbook, or module name as required

    pete

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Posts
    100

    Re: Very Urgent....pls help

    Hi,

    After using the code given, i get the follwoing error message.

    "
    Runtime error '380'

    Could not set the value property. Invalid property value. "

  4. #4

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Posts
    100

    Re: Very Urgent....pls help

    Hi,

    After using the code given, i get the follwoing error message.

    "
    Runtime error '380'

    Could not set the value property. Invalid property value. "

    The above error points to the follwing code

    VB Code:
    1. frmNewLeadEntry.Show

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Very Urgent....pls help

    you might need to set test2 as the active workbook

    windows("Test2.xls").activate

    or try prefix the form, with the worksheet similar to the macro

    pete

  6. #6

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Posts
    100

    Re: Very Urgent....pls help

    Hi,

    I still get the error message

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Very Urgent....pls help

    sorry i am out of ideas, if you want to post a sample of the 2 spreadsheets someone may well look at it for you, but i won't now till tomorrow

    pete

  8. #8

    Thread Starter
    Lively Member
    Join Date
    May 2005
    Posts
    100

    Re: Very Urgent....pls help

    I have managed to solve it thanx.

  9. #9
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Very Urgent....pls help (Resolved)

    Hey, post up how you solved it - even if it is simple, then we can also know how you did it... and congrats btw in fixing it

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width