ActiveX controls move when pushing XML data into Excel Table - excel

I am pushing XML data into an Excel Table via C#, but when I do this, my ActiveX checkboxes lower on the page do not adjust their position. The spreadsheet rows move down, but the checkboxes do not.
Also, at times it seems like even though the cells on the spreadsheet shift down, the row heights do not, messing up the formatting.
I tried messing around with the properties of the checkboxes, but still got the same behavior.
Thanks.

have you set "Format Control / Properties" of your CheckBoxes to either "Move and size with cells" or "Move but don't size with cells"?
When you insert full rows the controls will move down.
When you just insert cell ranges with option "Shift cells down" you must ensure that the cell range boundaries (left/right) are wider than the space occupied by the controls (checkboxes including caption), as the control will be shifted down only in this case. So make your cell range larger or the Checkbox smaller.
Hope that helps - good luck - MikeD

Related

How do I hide or remove the resizing handle in the last, or bottom-right, cell of an Excel table?

Is it possible to hide or remove the resizing handle in the bottom-right cell of an Excel table? I've tried various property settings, turned the total row on and off, etc.
One way to hide the table's resizing handle is by protecting the sheet.

Deleting a pivot table in Excel; no gridlines remaining

I've deleted a pivot table in code by first selecting it, and then pressing delete. The area that the pivot table occupied is now not displaying gridlines. All other cells in this sheet are displaying gridlines. I have googled this problem, and several suggestions have been mooted in response to similar questions. These include:
Navigate to Page Layout tab, and click on View Gridlines.
Navigate to File / Options / Advanced, and ensure Gridline Colour is set to Automatic.
Select the affected cells, and click Ctrl+1 to format the cells. Go to the Border tab and ensure that none of the borders are active.
Select the affected cells, navigate to Home tab on the ribbon, and set the Colour Fill option to No Fill.
Ensure that there is no conditional formatting on the spreadsheet.
None of the above work. However, if I copy and paste a cell from an unaffected area of the spreadsheet to the affected area, the gridlines then become visible. This is not an ideal solution though.
Can anyone help?
I can't seem to attach a version of the spreadsheet to this post.
A cell does (simplified) contain a content and a format. By using ENTF key you clear content. If you want to delete both there is two ways:
By VBA:
You need to clear Formats on the range as follows:
Range("your Range").ClearFormats
The format remains because you have used clearContents by just deleting
Use Range("Your Range").Clear to delete both content and format
Without VBA:
See the picture below and select ClearALL in the Menu
Select the area where your PivotTable used to be, and then go to "Home" > "Editing" > "Clear" ([Alt],[H],[E],[A])
You have deleted the contents of cells, but not the cells themselves, not the special PivotTable formatting.

Excel sheet size/scrollbar resizing issue when going too far down a sheet

So I've run into this issue for years but it's not systematic in how I operate. It really only happens on the occasional screw up of a macro, or mistyping of keys, or something of that sort.
If I hit Ctrl+down in a blank spreadsheet and input a value in the 1048576th row, then delete/clear that cell and hit Ctrl+up, the sheet will not resize and think that the size of the sheet is still as big as the 1048576th row. It is indicated by the fact that the scroll button is so small and covers a great distance of rows when moved. I can then select the whole range of the sheet and delete, and it still thinks the size of the sheet is that big.
How do I resize the sheet if deleting all the rows does not work? I would like to avoid creating a new sheet like this guy suggests.
Save the workbook after deleting rows and the slider will resize to normal. Took me a while to figure that one out:)

Excel Locked Cells

So I have a worksheet that I have exported and easily formatted without code from SharePoint. I have cells A11 through R11 that I want locked so when I refresh the column widths don't go back to normal as I wrapped the text. Any help would be greatly appreciated.
I know VBA might have to be used and if so I would love a little description of why.
The following will keep certain column widths from being adjusted:
1. Select all the cells
2. Right click and choose Format Cells
3. Go to Protection tab and uncheck Locked
4. Select the columns you want to lock and repeat steps 1-3 above (this time check Locked)
5. Go to Review tab and deselect Select Locked Cells.
6. Click okay
That should work for you.

Altering Excel Font Rendering to Fit Content in Various Zoom Levels

You can easily fit the content of your cells by selecting a series of columns and double clicking with your cursor between two cells. However, if you zoom in or out the rendering of the cells changes and what had been autofit changes relative to the size of the cell and you end up with a #####.
Is there a way to autofit cells that will hold irrespective of the level of zoom?
This is probably more question for the software development team at Excel but perhaps a VBA band-aid fix could be implemented in the interim, if the problem is ever addressed.
Thanks!
Unfortunately the zoom level (by scrolling with the mousewheel) by default cannot be captured to trigger a VBA script.
The only solution seems to be to have a VBA subroutine running in the background constantly that stores the current zoomlevels and the sheet they apply to in a Public variable.
When that variable is different from the one currently observed from the application you need to activate Autofit for all the worksheet columns again.
Alternatively you could just store a single number (THE zoomlevel), then when you switch between sheets that have different zoomlevels the subroutine will immediately Autofit for the sheet you switch to.
Ofcourse you have to consider the intervals at which this is done.
Last alternative is to Autfit manually whenever you spot such occurence...
There is a menu button who does that automatically. For me it is in the Ribbon "Start", than "Rows" , than "Format" than one of the Columnwidth options.
Excuse the vague description, I am using a german version of Iffce.

Resources