ybian / treeplan

The Excel add-in for tree plan, free and modern version.
MIT License
71 stars 30 forks source link

1004 ERROR #1

Open edi43 opened 3 years ago

edi43 commented 3 years ago

Hi Bian, whener you open a file that contains a macro, an error 1004 message pop-up saying "unable to assign columnwidth property of range class". Then when I click debug the image attached shows up and I don´t know what to do. I also get the following message when I open other excel files: Run-time error 1004 has occurred. The error defined by the application or the object. Can you please tell me what can I do? @ybian

error messages.docx error messages.docx

ybian commented 3 years ago

Sorry, I haven’t touched this plugin for years. I guess it is some random compatibility issue in some Excel versions. Try to search the error with Google and see if it can be fixed.

The function is trying to find the size for a “square” cell.

-Ying On Jun 23, 2021, 23:08 +0800, ybian/treeplan @.***>, wrote:

unable to assign columnwidth property of range class

Hans-Song commented 2 years ago

Decision Tree folds back from leaves to root to compute value of the node. So the values on the node above may not be added to values down the nodes. Tree plan Adds down to the leaf from the upper nodes. This computes wrong values.

wfphillips128 commented 11 months ago

Edi43,

I received a similar error message as shown in your uploaded screenshots. However, the add-in starting working perfectly for me once removed the following files from my XLSTART folder:

Book.xlt Sheet.xlt

It's a very late response, but I thought I would share as it might help someone.

BenjaminWadeGoulart commented 5 months ago

Edi43,

I received a similar error message as shown in your uploaded screenshots. However, the add-in starting working perfectly for me once removed the following files from my XLSTART folder:

Book.xlt Sheet.xlt

It's a very late response, but I thought I would share as it might help someone.

Where is the XLSTART folder?

Edit: Actually, my two XLSTART folders shown in Trusts Locations are empty.

Edit again: Found another location

C:\Users\goulart\AppData\Roaming\Microsoft\Excel\XLSTART\

But only a UbitMenu04 add in is inside it.

wfphillips128 commented 5 months ago

Edi43, I received a similar error message as shown in your uploaded screenshots. However, the add-in starting working perfectly for me once removed the following files from my XLSTART folder: Book.xlt Sheet.xlt It's a very late response, but I thought I would share as it might help someone.

Where is the XLSTART folder?

Edit: Actually, my two XLSTART folders shown in Trusts Locations are empty.

Edit again: Found another location

C:\Users\goulart\AppData\Roaming\Microsoft\Excel\XLSTART\

But only a UbitMenu04 add in is inside it.

There are several ways to find the XLSTART folder in Windows, but the location of the XLSTART folder is dependent on your OS version, your Office (or standalone Excel) version, and is user specific. Since you note multiple XLSTART folders are on your machine, I would suggest using the Visual Basic Editor (VBE) from inside of Excel to find the location. This would give the file path of the XLSTART folder used by the current instance of Excel - which would presumably be the same Excel instance running into the Tree Plan error.

I have pasted the text below from the Internet which explains how to use the VBE for this purpose: https://sprestridge.net/excel/2020/01/30/XLStart.html

"Since the location is rarely accessed it can be difficult to remember where it is located. The quickest way to locate it is to use the Immediate window in the VBE.

Press Alt-F11 to launch the VBE.

If the Immediate window isn’t visible, press Ctrl-g or use the View menu to open it.

In the Immediate window, type ? application.StartupPath and press Enter. VBA will display the path to XLStart.

You can copy and paste the path into File Explorer or a terminal prompt to navigate to the location."

wfphillips128 commented 5 months ago

Edi43,

I received a similar error message as shown in your uploaded screenshots. However, the add-in starting working perfectly for me once removed the following files from my XLSTART folder:

Book.xlt Sheet.xlt

It's a very late response, but I thought I would share as it might help someone.

After getting Tree Plan to work in late 2023 without any files in the XLSTART folder, I was able to recreate my "Book.xlt" and "Sheet.xlt" templates using the current Excel template file formats ("Book.xltx" and "Sheet.xltx"). Since its been awhile, I'm not 100% certain but I recall the new templates might error out the Tree Plan add-in if the templates used either custom column widths or row heights. [My memory may be off and the add-in error may have been strictly due to the number or rows and columns in a very old Excel file format, but I think think there was a separate issue that I resolved with some trial and error.]

In any case, after I kept the new template files ("Book.xltx" and "Sheet.xltx") fairly generic but based on the newer Excel file format. If you use a macro workbook in the XLSTART folder, I suspect that it best to make sure it uses the current Excel file format as well (PERSONAL.XLSB versus PERSONAL.XLS). Hopefully this helps if you want custom versions for "new workbooks" and "new worksheets", but still need the add-in to work.