• Excel Macro failing to run from Access call… (97 SR-2)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Excel Macro failing to run from Access call… (97 SR-2)

    Author
    Topic
    #391640

    Hello All…

    At the office, I’m running Access 97 and Excel (and the rest of Office) 2000… I was just wondering whether anyone has had, or heard of, a problem running Excel macros from within Access… I had added the code to a procedure in Access to open a workbook and run a macro… For some reason it seems to fail whenever it feels like it… No errors… No warnings… No patterns that I’ve noticed… Just doesn’t work sometimes… If I step through the code it works fine… Every time… ???… Strange but true… hmmn

    I’ve already worked it out… Got rid of the Excel macro and have all the code to manipulate the workbooks running from inside Access now… I’m simply curious as to whether this is a known issue, or if someone has a clue why it would happen… It would save me time for next time…

    Thanks in advance… smile

    Viewing 0 reply threads
    Author
    Replies
    • #700229

      If it works when you step through the code, but not always when you run it, there might be some kind of timing problem. Without seeing the code, it’s hard to say, but I guess it’s not that important any more.

      • #700232

        That’s what I thought too Hans…

        In my Access procedure I had two lines pertaining to this macro… (xlApp has been declared and set already)

        xlApp.Workbooks.Open Filename:= gstrFileLocation & “fxrates_import.xls”
        xlApp.Application.Run “fxrates_import!fmt_rates”

        The “fmt_rates” macro did some manipulation to make the data ready to import into Access…
        Does Application.Run not entirely complete before the next line of code in Access runs?

        • #700236

          It might well be that Access just passes the Run instruction to Excel, then goes on to the next instruction. But I am not sure.

    Viewing 0 reply threads
    Reply To: Excel Macro failing to run from Access call… (97 SR-2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: