Results 1 to 2 of 2

Thread: a Sub in Excell

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    Hello,

    How can I activate a "Sub" (the sub is located in a module) in an Excell workbook with a vb5 aplication.


    for example:


    this is Sub in Excell

    Sub print_plan()

    Call dbShopOrder.SearchOrders
    Worksheets("plan").Activate
    ActiveSheet.PrintOut

    End Sub

    greetings R@emdonck

    [This message has been edited by R@emdonck (edited 12-11-1999).]

  2. #2
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Here's a VB sub I use to run an Excel sub routine. All of my Excel modules are in an Excel sheet named "Macros". This one runs
    Sub LocValue().
    Al.

    Sub DataToExcel()
    Set XLsheet = GetObject("c:\excel.xls\Macros.xls")
    XLsheet.Application.Visible = True
    XLsheet.Parent.Windows(1).Visible = True
    XLsheet.Activate
    XLsheet.Application.Run "'Macros.xls'!LocValue"
    XLsheet.Application.Quit
    Set XLsheet = Nothing
    Exit Sub
    End Sub


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