+ Reply to Thread
Results 1 to 13 of 13

Full path to a form

  1. #1
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Full path to a form

    The following code is supposed to open a form when the Excel package starts. It's located in "ThisWorkbook" module.

    Please Login or Register  to view this content.
    Instead, I get a Path/File access error message. Debug identifies the last line but freezes the program.
    What am I doing wrong? Do I need to include the full path to the form? If so, how is that done?
    Thank you

  2. #2
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Full path to a form

    If the name of the form is same as the one in the Form properties, this should work

    Also, the first line,
    Please Login or Register  to view this content.
    can be skipped too.

    If this doesn't work attached the spreadsheet.
    If you think someone helped you, click on the "* Add Reputation" as a way to say thank you.

    If your problem is solved, go to Thread Tools and select Mark This Thread Solved

  3. #3
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    The name is the same. I thought it should work, too! I'm afraid I can't attach the workbook, too big and too sensitive. Maybe I need to load the form first?

  4. #4
    Valued Forum Contributor saravnepali's Avatar
    Join Date
    01-14-2019
    Location
    Sydney Australia
    MS-Off Ver
    2010
    Posts
    447

    Re: Full path to a form

    You can remove the sensitive information & then upload the workbook, if you wish to do so. (SEE THE YELLOW RIBBON ABOVE FOR INSTRUCTIONS)

    I tried the code on a simple form and it worked properly.

  5. #5
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    I'm so sorry I can't upload the workbook. There are 19 modules and as many sheets plus three forms. The command to show the form is so basic, the problem probably lies in the order of calling.

    I have not used a "Load" command nor any "initialize" anywhere but I have one activation procedure which is in the code of the form, not in a separate module.
    Please Login or Register  to view this content.
    The code within the activation is not included here because it isn't an issue.

    The form shows up fine once the package is loaded. I can call it up with a key combination. It's just in ThisWorkbook that it fails.
    So, two questions:

    1. When Excel opens, does it need a "Load Form" first or is that used only if more than one instance of the form is needed?
    2. Do I need an initialize procedure for the form or is the activation sufficient?

    Thanks.

  6. #6
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Full path to a form

    Can you post the userform code?
    Click the * Add Reputation below to say thanks.

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

    Re: Full path to a form

    Try moving the code that shows the form to a routine in a normal module like this:

    Please Login or Register  to view this content.
    then amend the Workbook_Open code to this:

    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  8. #8
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    The userform code is a series of simple procedures connected to buttons. They aren't the problem.
    If I put almost anything in the Workbook_Open() procedure, the whole package crashes. For example:
    Please Login or Register  to view this content.
    causes and Automation error and major malfunction.
    Someone suggested cleaning the entire pacakge, and I may try that.

  9. #9
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    Okay, I will try this very soon. Thank you. (In reply to RoryA)

    I have tried this now but no luck - received Automation Error and complete system meltdown.
    I'm not sure this thread can be resolved here. I think there is some bloating and serious cause for concern deep within my package which needs attention, perhaps some VBA / XML cleaning.
    I may do a complete export and import of modules - again.
    Thanks for your ideas - in normal circumstances they should work.
    Last edited by insomniac53; 12-04-2019 at 08:28 AM.

  10. #10
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Full path to a form

    Is your file in a cloud storage?

  11. #11
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    Quote Originally Posted by dotchiejack View Post
    Is your file in a cloud storage?
    Good point. Yes and no - I was using OneDrive but it was giving me so much grief I moved my work to sync with Dropbox - but the actual Excel file is on the hard drive, on top of the Dropbox folder. I will try something - I'll make a copy onto a drive area that does not sync and see if that works. Thanks for the idea.

  12. #12
    Registered User
    Join Date
    08-30-2014
    Location
    Lincoln, England
    MS-Off Ver
    Office 365
    Posts
    74

    Re: Full path to a form

    Quote Originally Posted by dotchiejack View Post
    Is your file in a cloud storage?
    Well well! I tried the package without the sync and it worked like magic. I need to test it over a longer period, but if this is the issue, I don't understand why. Never mind, thank you so much for the suggestion.

  13. #13
    Valued Forum Contributor dotchiejack's Avatar
    Join Date
    05-21-2015
    Location
    Antwerp,Belgium
    MS-Off Ver
    2016
    Posts
    507

    Re: Full path to a form

    Glad it worked.

+ 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. Replies: 1
    Last Post: 11-18-2016, 03:33 PM
  2. UDF full reference to path
    By ayearsley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-30-2010, 11:27 AM
  3. Replies: 7
    Last Post: 10-09-2009, 10:10 AM
  4. Full path-name in title bar ?
    By Stefan in forum Excel General
    Replies: 10
    Last Post: 08-17-2006, 06:00 PM
  5. [SOLVED] Full path possible to be seen?
    By Octavio in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 07-02-2006, 04:00 PM
  6. Re: Full path in title bar
    By ntoze in forum Excel General
    Replies: 1
    Last Post: 04-18-2006, 11:25 AM
  7. [SOLVED] Full path in taskbar
    By GregR in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-08-2005, 11:05 PM

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