+ Reply to Thread
Results 1 to 4 of 4

Inserting a macro using another macro (or similiar)

  1. #1
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Question Inserting a macro using another macro (or similiar)

    Hello everyone,

    I have a macro which creates a new workbook and on this workbook it inserts some data and does different editing etc etc

    My problem is that after this macro completes (and i close excel down completely), if i wish to run it again my macro crashes.

    I've identified by watching the running processes list in windows that the cause of the crash is due to the EXCEL.exe process not fully terminating upon closing the (newly created) worksheet.

    A potential solution to this problem that I've identified is to have my macro that creates the worksheet, insert an additional macro into the before worksheet close module - forcing the EXCEL.exe process to fully
    terminate once the user closes the workbook.

    Are any of you guys familiar with something similar to this? or do you perhaps have a different approach to solving this issue

    Once again thank you in advance!

    Jordan

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: Inserting a macro using another macro (or similiar)

    Does the initial macro save the new workbook?
    If so it may be crashing when trying to save another of the same name.

  3. #3
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Inserting a macro using another macro (or similiar)

    No the initial Macro does not save anything.
    It simply creates a new workbook which remains open after the initial macro.

    The initial macro exists within a CAD based drawing program - which references excel object libraries.

    Like i mentioned in my original post the issue seems to be arising from the multiple instances of EXCEL.exe running.

  4. #4
    Forum Contributor
    Join Date
    11-16-2011
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    405

    Re: Inserting a macro using another macro (or similiar)

    Is it possible to edit the newly created excel workbooks modules using something similiar to this
    Please Login or Register  to view this content.
    source: http://www.dbforums.com/microsoft-ac...erminated.html

    Can i manually arrange its workbook.before close module using something similiar to the above: and in this module tell it to terminate the excel process?

    regards!

+ Reply to Thread

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