+ Reply to Thread
Results 1 to 22 of 22

Trouble exporting userforms

  1. #1
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Trouble exporting userforms

    Hi,

    I have attached my workbook for reference.

    Problem: When I run my macro in module1 on my computer, it works perfectly. When I transfer the excel to another computer and attempt to run it, for some reason my userforms don't get exported to the temp. string like they should, hence my code won't run. The macro can be run from the command button at the bottom of sheet1. Any suggestions?

    Thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    This is the code that doesn't seem to be running on the other machine.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    just a note:
    There is a typo in this line The number 1
    Please Login or Register  to view this content.
    maybe it should read letter lowercase L
    Please Login or Register  to view this content.
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  4. #4
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    also...you may need to point excel to these properties incase they are not referenced on the other machine.

    Please Login or Register  to view this content.
    edited "xlSheetVisible" to "xlSheetVisibility"
    Last edited by jwright650; 03-31-2011 at 02:06 PM. Reason: edited code

  5. #5
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    Good eye, thank you.

    Can you guide me on how to do this pointing?

    thanks
    Last edited by calmena; 03-31-2011 at 02:03 PM.

  6. #6
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    Open your object browser in the VBA Editor and you can see the paths of the properties if you search for an object.
    ie. search for
    xlSheetHidden

    and it returned(on my machine)
    this path --> Excel.xlSheetVisibility.xlSheetHidden

  7. #7
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    ah, I missed the last part of your reply. Are you saying replace visible with visibility, or insert another line of code assigning sheetvisible = sheetvisibility?

  8. #8
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    no...I had a typo and corrected it.

  9. #9
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    I'm sorry, I really don't understand what your recommending. I don't see anywhere where I can do a search and if I did, what I should do about the result.

    Also, I'm not sure this has anything to do with my original problem in exporting and importing userforms. My tab visibility is working correctly.

  10. #10
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    When I ran your module1 it stopped on those lines referencing the visibility stating object not found....but it ran fine after I used the object browser (F2) to find the path it needed.
    I used this search criteria
    <All Libraries>
    <xlSheetHidden>



    I thought this may have been the problem you were experiencing on the other machine.
    Attached Files Attached Files
    Last edited by jwright650; 03-31-2011 at 02:29 PM. Reason: added Word doc

  11. #11
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,006

    Re: Trouble exporting userforms

    Your code doesn't specify a path - where are you looking for the exported forms?
    Everyone who confuses correlation and causation ends up dead.

  12. #12
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    jwright, I understand what you're talking about, however I am not getting that error on my other maching. I am getting the error when it tries to call the userform and it can't find it. So I open the project explorer and the userforms are not there; hence they didn't get copied over.

    romperstomper, I have tried to specify a path to see if that was the problem, and all that did was cause errors when I ran the code on my machine now. So I'm not sure why I don't need to specify a path on my machine and it works good, but when I do specify a path, the code no longer works.

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,006

    Re: Trouble exporting userforms

    If you don't specify a path it will go to the current directory, whatever that may be (and it may not be what you think).
    Do you get an error? (or do you have an error handler that may be suppressing it?)

  14. #14
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    does it matter if it goes to the current directory as long as it knows to pull it from the current directory?

    anyways, I changed the code above to look like this which is specifying a path.

    Strangely enough, what happened is that now its not copying my userforms on my machine any longer, which means to me, it's not running this code. Have I specified the path incorrectly?

    Please Login or Register  to view this content.

  15. #15
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    Another suggestion....

    use the "locals window" in VBA and step through(F8) your code line by line and watch the variables and paths in the locals window as they are found by the code as you step through. Sometimes you can see when variables don't get passed correctly or passed as you thought they were.

  16. #16
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,006

    Re: Trouble exporting userforms

    The path looks OK - if you step through the code can you see the files being created?
    You didn't mention whether you have an error handler in place or not?

  17. #17
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    So I followed it in locals and just confirmed what I already new. so I'm back to square one. any suggestions on why my userforms and modules will copy on my computer but not on any other computer?

    thanks.

  18. #18
    Registered User
    Join Date
    01-17-2011
    Location
    calgary, alberta
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Trouble exporting userforms

    I do have an error handler in place.

    On my computer, I can't see the files being exported, but I can see them being imported. On the other computers, I can't see them being exported or imported.

    I have attached the latest copy incase someone wants to tinker with it. This is fully functional on my computer, but likely won't run module 1 on your computer for some reason.
    Attached Files Attached Files
    Last edited by calmena; 04-07-2011 at 06:23 PM.

  19. #19
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    Please Login or Register  to view this content.
    I think there is something wrong in here...although I don't know what it is exactly.
    (need some help from the VBA experts here)
    I was thinking through the process of creating a new workbook and having to Export the UserForms out of the original Workbook to get them into the new Workbook...seems there is a step or two missing.....

    When I export UserForms out...I have to save the file as UserForm.frm into a folder on my computer somewhere before I can Import them into the new Workbook....where is that happening in this code?

    Then to Inport the UserForm, I have to go to a folder on my computer and select the .frm file that I want to Import....where is that happening in this code?

  20. #20
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    TMShucks asked a question while discussing this thread about whether the "VBA Project is trusted" or not....so I did a little digging in the "Locals" window while stepping through Module1 line by line.

    I'm not sure how to correct this, maybe some of the others here can help get this fixed...

    See the attached .doc
    Attached Files Attached Files

  21. #21
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    Were you able to get this resolved?

    I fooled around with the file again today, but still can not get the UserForms and Module to export from the existing and import to the newly created workbook correctly.

  22. #22
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Trouble exporting userforms

    Another thought....how about copying the entire workbook(this would grab the UserForms and Module), then deleting out the existing data from the new workbook?

+ 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