+ Reply to Thread
Results 1 to 4 of 4

Trying to Enter data into a Save As box that another macro creates

  1. #1
    Registered User
    Join Date
    02-12-2018
    Location
    Texas, US
    MS-Off Ver
    2010
    Posts
    14

    Thumbs up Trying to Enter data into a Save As box that another macro creates

    Hello

    Quick back story, I'm using a workbook that has various macros that I cannot access the code for. I'm able to find the macro names and run them, but am unable to access or change any of the code.

    What I'm attempting to do to create my own macro which opens said macro, inputs new data, then runs one of the workbook's macros which produces a new file and save it.

    I've made a macro that opens up said workbook, inputs new data where needed and then runs one of the workbook's macros. My issue is the workbook macro produces a "Save As" box which I'm not sure how to access via my own macro. I could easily do it if I prompted the Save As, but since the workbook macro did, I'm not sure how to give it a name and file path.


    I'm still a novice at writing macros. I've created many, but it's mostly by looking up expressions and piecing it together. Never had any formal training.

    Thanks in advance for anyone taking pity.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Trying to Enter data into a Save As box that another macro creates

    It may help to see your code.

    Depending on what the other workbook's macro does, it may be easier to write your own macro that does the same thing rather than calling the other macro. Interacting with dialogs from a separate macro is not easy.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-12-2018
    Location
    Texas, US
    MS-Off Ver
    2010
    Posts
    14

    Re: Trying to Enter data into a Save As box that another macro creates

    I'm unable to the other workbook macros as they are locked, also it does a great many things that I wouldn't know how to start if I tried to code it.

    I've attempted to disable Save As, but that didn't work. If I was able to 'cancel' the SaveAs after it starts that would work too.

    Here's the code with private info removed.


    Workbooks("A").Activate
    Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save As...").Enabled = False
    Worksheets("PXC").Activate
    Application.Run _
    "A!Sheet365.RunXX_Click"

    Application.Run _
    "A!Sheet365.Typ_Click"

    (It's the Typ macro that produces the Save As box).

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Trying to Enter data into a Save As box that another macro creates

    I don't know a way to do it. While the SaveAs dialog box is displayed, Excel stops code execution. So the code can't close the dialog.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How do you create a macro that creates a PDF report of your data?
    By lougs7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2017, 12:17 PM
  2. HELP! save and enter data in new row....
    By phatus in forum Excel General
    Replies: 1
    Last Post: 06-28-2017, 02:15 PM
  3. [SOLVED] Macro Creates Unknown Data Connection
    By shadedrivein in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2012, 11:20 AM
  4. Macro creates new worksheet (already ready) but i need a little bit of data to be added
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 06-08-2012, 10:04 AM
  5. Replies: 11
    Last Post: 02-13-2012, 06:10 PM
  6. macro creates new sheet with data from other sheets
    By jdcns in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-11-2011, 08:28 AM
  7. Save works fine, but Save AS creates havoc
    By cincyfire in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2009, 07:28 PM

Tags for this Thread

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