Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Problems running excel macro from access

Discussion in 'Information Technology' started by Kate, Jul 28, 2006.

  1. Kate

    Kate
    Expand Collapse
    Guest

    I am trying to run an excel macro from access. First I open the
    spreasheet, then I run the macro.

    This is my code:

    Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
    Set xlx = CreateObject("Excel.Application")
    xlx.Visible = True
    Set xlw = xlx.Workbooks.Open("H:\Data\Enztec Files\1300 Marketing\04 -
    Pricing\Price Lists and Costings\C Costing Database\Route Card
    Template.xls")
    Set xls = xlw.Worksheets("Route Card")

    Dim strFile As String, strMacro As String
    strFile = "Route Card Template"
    strMacro = "RouteCard"
    Set xlx = CreateObject("Excel.Application")
    xlx.Visible = True
    xlx.Run strFile & "!" & strMacro

    But it won't run the macro? How Come?
    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Sikhs Face Problems While Carrying Kirpans In Khyber-Pakhtunkhwa - SikhSiyasat.Net Breaking News Jul 29, 2016
    "Dasam" Granth - A Look At The Core Problems Dasam Granth Oct 21, 2015
    Problems In Life Sikh Sikhi Sikhism Apr 13, 2015
    Muslim Girl-Sikh Boy Marriage Problems- Please Help! Love & Marriage Oct 12, 2012
    Problems with Sikh Historiography-prof Jagdish Singh Sikh Video Aug 31, 2012

  3. Larry Daugherty

    Larry Daugherty
    Expand Collapse
    Guest

    What does "But it won't run the macro? " mean? There seems to be
    some detail missing. :)

    Try moving your code into a new Excel workbook and debug it there.

    Once the code problems are fixed, move it back to Access.

    HTH
    --
    -Larry-
    --

    "Kate" <ktm19@student.canterbury.ac.nz> wrote in message
    news:1148513139.299648.274630@y43g2000cwc.googlegroups.com...
    > I am trying to run an excel macro from access. First I open the
    > spreasheet, then I run the macro.
    >
    > This is my code:
    >
    > Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
    > Set xlx = CreateObject("Excel.Application")
    > xlx.Visible = True
    > Set xlw = xlx.Workbooks.Open("H:\Data\Enztec Files\1300

    Marketing\04 -
    > Pricing\Price Lists and Costings\C Costing Database\Route Card
    > Template.xls")
    > Set xls = xlw.Worksheets("Route Card")
    >
    > Dim strFile As String, strMacro As String
    > strFile = "Route Card Template"
    > strMacro = "RouteCard"
    > Set xlx = CreateObject("Excel.Application")
    > xlx.Visible = True
    > xlx.Run strFile & "!" & strMacro
    >
    > But it won't run the macro? How Come?
    > Thanks
    >
     

Share This Page