OK. Found the "show errors" and activated it. No special errors other than the initial error with which I started this thread.
Posts by pvman
-
-
Try checking the option to show add-in user interface errors and see if you get any useful messages when the add-in tries to load. I assume you did not include the workbook name in any of the callbacks in the CustomUI
I don't remember using the file name in any of the callbacks. I actually looked for such a reference before even calling here, but will check again.
Can you please point to to the where I can check the option to show add-in user interface errors?
-
Do you mean the code or callbacks? they are not the same as the file name. Should they be????
Each callback is referring to a certain piece of code and each piece of code has a unique name.
What is really baffling is that as an XLSM - the tab, buttons and code are working great.
It is only after the file is saved as an add-in that the problem starts.
I guess I am doing something wrong when saving the file as an addin, but for the life of me - I don't know what.
I am not an expert in theis, by no means, but this is not my first add-in...
I am now considering re-doing the whole project from scratch
-
If you have saved the addin to the default folder as an xlam file then it should open each time Excel is opened. No installation is really necessary.
The Ribbon is attached to the addin and should display.
How did you create the Ribbon?
At a lack of a better term I referred to it "selecting" the add-in and marking it - as "installation". I should have maybe said - activation.
In any case, the ribbon was created by using the CustomUI editor and subsequently by adding code to the callbacks (in the VBA editor).
The file was first saved as an XLSM and then re-saved as an XLAM
As you can see from the images, it seems that the TAB was created OK and actually - when working from within a XLSM - it is working OK and doing what it should do..
The problem began when it is turned the file into an Add-in.
For some reason, Excel is looking for PARTS of the code somewhere else (in a different file/folder).
As you can see from the images - after Excel starts, only PARTS of the add-in are visible after Excel starts (the Tab itself, it's name and the "group" name. All the rest is missing and I get the error message.
If I "uninstall" (de-activate) the add-in, these parts disappear and I don't get the error message any more.
I must admit that this is not my first "ribbon tab" but it IS the first time I see such a behavior.
-
What do you mean by "installed the addin"?
Well, The add-in is placed in the add-in default folder, and visible in the add-in "menu" under the development tab. I checked-market the add-in via that menu and the new tab became visible. In order to install - I do the reverse (un-check and delete from the default folder)
-
Hi All
I need help with the following problem:
I have created an code and a ribbon tab for it (works OK).
I then saved it as an add-in which was saved in the default add-in library.
I then restarted Excel (2010) and "installed" the add-in
So far so good... Now for the problem:
After restarting Excel - Excel gave me an error message which said that the add-in file cannot be found.
The problem is that despite that fact that I installed the add-in from the default excel library - Excel was looking for the file in the "Documents" folder.
The attached snapshot is mostly in Hebrew but I highlighted the relevant data.
The error reads something like: The file XXXXXX cannot be found. Check file name and location
If you are attempting to open a file from the recently used files list - make sure the file name has not changed and that the file was not deleted or moved.
The really weird thing is that after excel is showing the error message - Excel does load part of the add-in (despite the error message).
It loads the tab, but only the tab name and group name are visible. The buttons are not...
I hope you can help me solve the problem
TIA
-
Thank you very much. This is brilliant and does exactly what I needed.
@JD
Thank you as well, for your time and support
-
@JD
Thank you VERY much. On the sample I gave - this works perfectly
However, on the real file - there are a couple of snags
Apparently, the real file - which I just received - has a "0" preceding each number
There are also empty lines
I assume you already spent a lot of time on this, so - if you can - just give me some pointers and I will try to solve the issues myself
All the best and TIA
-
Hi all
I am trying to write a code that will loop through a string like this:
4885654, 598965, 536542, 765241597, 5999857
All numbers separated by a coma and a space and all the strings are located in the same column.
There are thousands of rows, and each string can have one to "n" numbers (usually no more than eight)
If a number in the string begins with 5 - I want to keep the number, but if the number begins with any other number, I want to delete it.
In the example above, the desired end result should be: 598965, 536542, 5999857
Any help will be highly appreciated,
TIA
-
Well .... that sucks ... But google has a remote desktop extension that you and your colleague can use. Then you could run / debug the code and see what's what for yourself.
Good idea
Will give it a try.
Thanks !
-
Well .... if possible YOU should be the one to run it on her PC. Debug / step through the code on her computer. Then see what's happening.
We are not in the same vicinity, hence my questions here
-
Well lo and behold I do have 2013. Your code worked fine.
This is very strange. This means that the problems my friend suffers are actually computer based, despite whatever she tells me. Sorry for wasting everybody's time...
BTW, before signing off from the topic, I just wonder if this is in fact an issue of code speed. Maybe if you run it on 50 images (or 100) the problems manifest themselves, while if you run it on 5 or 10 - there is no problem...
Maybe I should add a delay between each picture, to allow the image to be imported? maybe 0.5 second or even 1 second? -
Ok ...
Also, not sure how much you code, maybe try to put things that DO something into a unique routine or function kind of like this
First, thanks for the valuable input
Second, I code enough to gather bits and pieces from the web or from previous work I did, and modify/adapt the code to my specific needs :hubbahub:
As for your suggestion, I think I have tried it when I started with the code, but I seem to remember not getting the same functionality regarding image size (even though it the trade-in in not embedding the images in the file).This still brings to me the my original question, which still bothers me a lot.
Is my code compatible with Excel 2013 ?TIA
P. -
Do you step through the code 1 line at a time when in 2013?
Thank you for stepping in
No, unfortunately. I don't have 2013.
I made the code in Excel 2010 for a friend, to use at work, and she reported the problems.
BTW, She has a new computer (I5, 8GB, 256SSD, Win8.1 or 10) so I doubt the crashing is due memory or computing power is the issue). -
Bumping up...
Perhaps my problem was not clear. I'll try to clarify.
In my code there are a couple of lines there are lines responsible for selecting a file path for the images' location and inserting pictures in designed cells.(I marked with the following "comment":
<<<<<<<<??????????") Is there a chance that these lines are incompatible with Excel 2013?
When the code runs in Excel 2013 - it messes up the screen (like a screen saver that moves bits and pieces of the screen around) and/or Excel crashes or hangs.In Excel 2010 - the code seems to be working OK.
Can something else cause the problem I've described?Hoping to get some insights from you guys...
TIA -
Is it acceptable to bump up a question that was not answered?
A few days ago I asked a question but got zero replies (25 views...).
Maybe some members with the right answer simply missed it because it is now on page 4 or so...
There is no reference to this issue in the forum rules (at least none that I saw).
I simply want to post a "reminder", to bump my question the first page for another day or so (I assume that this is how the "mechanics" of the system works) -
I have this code that allows adding pictures to cells.
The user selects a range of cells that contains names of pictures, selects a location where to insert the pictures and then selects a folder where the actual pictures are stored.
The codes then places the pictures in the destination location.
The code also dales with landscape and portrait pictures,to give then all the same size (or rather row height )It is still WIP and needs some finish touches but is works... Sort of...
Under Excel 2010 (which I have) it seems to be working OK, but under Excel 2013/16 (which I don't have) - I am told it creates havoc.
It messes up the screen in a way that the entire screen looks kike it has been messed up by a screen saver app that creates a puzzle of the screen and moves prats of it around.
In many cases - It also causes the computer or Excel to hang or crash.
The computer is new (i5, 8G, Not sure which Windows is used. 7, 8 or 10)
Any thoughts? Maybe I am using wrong code lines? Am I using something which is Excel 2010 specific, that does not work well under higher versions?
Maybe the line that brings the pictures location is good for Win 7 but not for Win 8 or Win 10?BTW, apparently - the pictures are not embedded in the file. They are linked to it, and once sent outside the organization - the link is broken and only a place holer is kept in the cells.
Any ideas how to keep the logic of my code, while embedding pictures rather than linking them?Code
Display MoreSub AddPicsToCells() On Error Resume Next Dim FilePath As String Dim PicNameRng As Range Dim PicLocRng As Range On Error Resume Next PicSize = InputBox("Select pictures' desired size", "Select Size", 50) Set ws = ActiveSheet Set PicNameRng = Application.InputBox("Select a range with picture names", "Select location", Type:=8) PicNameRng.Select If PicNameRng Is Nothing Then Exit Sub Set PicLocRng = Application.InputBox("Select to top cell of the pictures", "Select location", Type:=8) If PicLocRng Is Nothing Then Exit Sub Application.FileDialog(msoFileDialogFolderPicker).Show FilePath = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1) '<<<<<<<<<<<<<<<<< ??????????????????????? Application.ScreenUpdating = False For i = 1 To PicNameRng.Count If PicNameRng(i, 1).Value = "" Or PicNameRng(i, 1).Rows.Hidden Then GoTo BlankCell If PicNameRng(i, 1) <> "" Then thisPicture = FilePath & "\" & PicNameRng(i, 1).Value & ".jpg" PicLocRng(i, 1).RowHeight = PicSize PicLocRng(i, 1).ColumnWidth = PicSize / 5 Set pic = ActiveSheet.Pictures.Insert(thisPicture) '<<<<<<<<<<<<<<<<<????????????????????? AspectRatio = pic.Width / pic.Height If AspectRatio > 1 Then With pic .ShapeRange.LockAspectRatio = msoTrue .Width = PicSize .Height = .Width / AspectRatio .Top = PicLocRng(i, 1).Top + 2 .Left = PicLocRng(i, 1).Left + 2 .Placement = xlMoveAndSize End With Else With pic .ShapeRange.LockAspectRatio = msoTrue .Width = PicSize .Height = .Width * AspectRatio .Top = PicLocRng(i, 1).Top + 2 .Left = PicLocRng(i, 1).Left + 2 .Placement = xlMoveAndSize End With End If PicLocRng(i, 1).VerticalAlignment = xlCenter PicLocRng(i, 1).RowHeight = pic.Height + 4 Else PicLocRng(i, 1) = "" End If BlankCell: Next i Application.ScreenUpdating = True End Sub
-
-
If they are unknown to you, how can the code know? Do you mean they actively select two ranges by highlighting them? Why not incorporate that into the macro so that it invites them to select the ranges?My bad... Sorry for not being clearer with the definition of the process/problem.
At the beginning of the run there are 2 input boxes, asking the user to select both ranges... (UserRange1 for the source and UserRange2 for the destination).
Now the code should loop through UserRange1, do it s thing, and put the resulting data in the relevant cells of UserRange2. -
Don't see why you couldn't use Offset or just refer to relative position of each cell as it will be the same in each range. How are the ranges to be selected?
Or something along these lines, which uses a formula so need to loop.
Thank for the very nice code but OFFSET is tricky because I have no idea which range the user will select as destination.
The user selects a a source range and a destination range, both are unknown to me in advance. I just know they are parallel (I will also need to verify this by code at a later stage, but for now - I have to trust the user).
That is exactly why I posted my question