• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

User form exports as *.frx, cannot import

BobBridges

Active Member
I'm pretty comfortable programming in VBA/Excel, but now I'm using a user form for the first time and I'm a little at sea. I've got it mostly working, but when I run the program to copy all the code modules from my development workbook to the client's copy, it exports the user form to two files. The code is exported to a file named *.frm; the file that describes the graphic image is named *.frx.

It does this automatically when I execute the one Export method for that module. But I cannot import the .frx file afterward, either in VBA or manually. Am I missing something, or is the graphic part of the user form simply un-importable? It seems to work when I manually drag and drop it from one project to another, but the import function simply fails (" 'path\filename' could not be loaded.").
 
Did you try first to export manually the UserForm then try to import it manually in a brand new workbook on the original computer ?​
 
I exported it manually to a file in a folder, and then tried to use the manual import function to get it into another workbook—but not into a brand-new workbook. Why would that matter?

When I do it with VBA, the program exports the modules from the source workbook to a folder, then erases all the code modules in the target workbook and imports all the modules from the folder. It works fine for the .bas and .cls module files, and I think it works for the .frm module too (that's the one that has the userform code in it). It's when it gets to the .frx file that I get the error message. I get the same message when I try to import it manually.
 
According to the usual mess it could be something weird - broken, damaged - within the UserForm​
but first - only manual operations - on a brand new workbook create an UserForm, add a single object like a text box​
then save the workbook, export the UserForm, close the workbook.​
Open a new workbook and try to import the UserForm.​
Maybe you use Excel 365 and since - let's say - two months several 365 versions have weird issues, in particular with UserForms …​
Scans ok with anti-virus and anti spywares ?​
 
So the .frx file does get imported (and *needs* to be imported), it's just that you do not have direct control over it. If you import the .frm file, the .frx comes with it. If you have a user form named "UserForm1" and you open the file "UserForm1.frm" in a text editor you will see a reference to the .frx file. If the .frx file is not there in the same folder (say you renamed or deleted it), you will get a 'load error' message when you try to import the userform. Any chance the .frx files got lost when you transferred them to your client?

Btw, you can satisty for yourself it behaves this way by exporting a userform, then manually moving or deleting the .frx file and try reimporting the corresponding .frm file.

More info
 
Well catch rlv01, I missed that so obvious point as only the .frm is to be imported …​
 
Ah, so you're saying if I import the *.frm file it'll automatically bring in the *.frx with it? Ok, that sounds plausible; thanks, I'll try it.
 
Back
Top