Results 1 to 7 of 7
  1. #1
    ahseenam is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    6

    How to export VBA code (NOT "VBA code to export other items")

    I'm working on someone else's database. Windows 8, Access 2010.



    When I have a VBA module I'm working on sometimes I can right click on it and export it. Some modules though, when I right click and select "Export File" nothing happens. Nothing... like no error message, it doesn't hang, nothing at all. I can go do anything else immediately afterwards. What would cause this to happen?

    I've been trying to google this but I keep getting results for how to use VBA code to export other items, not help on how to export VBA items themselves.

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    I notice Access will have little quirks that stop working for various people.

    If you tried export via table side of access, did you try the export in the VBE side?
    Here you right click, export, but you must export to a file (not to another db)
    if that works, goto the other db, then VBE, then import the module.

  3. #3
    ahseenam is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    6
    Yes... sorry my initial question wasn't clear. I am trying to just export file, not export to another db. When I'm in VBA and I right-click on a class/module/etc and try to Export File, sometimes it works fine. Other times (for some modules I actually need to export) nothing at all happens... no freezing, no errors, nothing at all. Look at the image to see what I'm clicking on in a sample db. Could there be some settings in the module I'm trying to export that prevents exporting? I'm not getting any error so I'm not sure that's it.

    EDIT: Additional note... I do have full rights to edit anything in this db. I have no restrictions.

    Click image for larger version. 

Name:	Capture.PNG 
Views:	10 
Size:	65.9 KB 
ID:	18298
    Last edited by ahseenam; 10-03-2014 at 12:02 PM. Reason: add note

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Yeah, we're back to the quirks. sometimes my TABLE MANAGER stops working. Other days its fine.
    I HATE THAT.

    If the export dont work,
    open the module
    Ctl-A (select all)
    copy
    paste into notepad.

  5. #5
    ahseenam is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    6
    Thanks. That's what I've been doing all along as a workaround -- just copy & paste into txt file, and then ask the recipient to copy the code back into their database. Just trying to figure out why export file does not work.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Have you been editing the code just before trying to export? Possibly the code changes are not saved.

    Also try "Compile", then save before exporting.
    Maybe even "Compact and Repair" before export.

    I have not had this "quirk" occur to me (yet).

  7. #7
    ahseenam is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    6
    Yeah, I've tried to decompile/compile, I've run C&R.

    I just can't figure out why Export File silently fails, and only on some modules.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 07-12-2014, 02:02 PM
  2. Replies: 4
    Last Post: 02-13-2013, 02:35 PM
  3. Access 2007 query export to Excel "feature"
    By sensetech in forum Import/Export Data
    Replies: 6
    Last Post: 11-03-2012, 04:24 AM
  4. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  5. Replies: 0
    Last Post: 01-11-2012, 12:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums