Results 1 to 4 of 4

Thread: SaveAs code

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    North East US
    Posts
    3

    Exclamation SaveAs code

    Hello,
    Im writing a macro and need to know how to Save the drawing I created with the macro, within the code. The macro runs, then the Save As window pops up. The only help I can find in the help file is dwg.SaveAs, or just SaveAs. However I do not know how to impliment it. If anyone has some code with this function, Id love to take a look at it just to compare what Im trying to do with what works. Thanks so much.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SaveAs code

    HighHelix, this is for your autocam program? Usually the .SaveAs requires an expression that relates to the
    document, workbook, or presentation. In your case it should relate to a drawing. I dont know what the object
    is in autocam, but it should go something link this...

    VB Code:
    1. Drawing.SaveAs "C:\MyFile.???", Arg2, Arg3, ...
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    North East US
    Posts
    3

    Re: SaveAs code

    Do I have to specify what the file should be called? I need to run this macro over and over again and I dont want to declare a file name within the macro. I need the Save As window to come up so I can name the drawing. Im going to pick up a book, but it is difficult because of the unique application. CNCs are now commonplace for Millwork companies and I know lots of people who would write their own code, except no one has written a book on writing VBA code for CAM applications. Know any authors? Id be happy to provide technical info for co-author rites!

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SaveAs code

    I dont know of any off-hand, but I'll keep it in mind.

    You should be able to use the Object Browser to see all the available objects and their methods/props/events.
    Usually you can press F2 to bring it up. In this browser you can search for the Save and SaveAs. It should
    have a brief syntax description too.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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