Column size not working for data rows

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
1,060
Office Version
  1. 365
  2. 2007
Platform
  1. Windows
Hello folks. I have a strange situation - I am resizing the width of column A, but the resize doesn't seem to 'take' on the data rows borders. This only happens if I run a macro in a different workbook that sends a CDO email (the macro actually fails but closes all CDO objects). See the snapshot - I resized column A wider, then narrower but you can see the column letters are offset compared to the columns. (Ignore the blue line). The actual cell size seems to be the narrower size. I have rebooted the PC and it still does the same. Does anyone have any idea what's happening? This is excel 365 desktop version.

1610551191987.png
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I would bet if you turn on word wrap on column A then the resize would work as expected.
 
Upvote 0
I've seen this weirdness before. I can't remember if was able to solve it.
 
Upvote 0
Hi Candyman - unfortunately not:
 

Attachments

  • 1610615665095.png
    1610615665095.png
    3.4 KB · Views: 1
Upvote 0
Does it persist if you switch sheets?
 
Upvote 0
Hi Rory. Very strange things happen! I am posting the code I run in the other workbook, but as far as I can see (apart from the fact that it errors on the send) there is nothing special about the code. In the error routine which is invoked, I am closing the created objects and resetting the error state, so there should be no issues there. The workbook giving problems is a non-macro workbook.

Anyway, the previously described events happen on a single sheet, but if I try to switch to another sheet, the click on the sheet name doesnt work. If instead I create a new sheet, go to it and then back to sheet 1, sheet1 becomes correctly displayed and editable, however I cannot switch between sheets.

Here is the code from the original workbook:
VBA Code:
Sub FormatandSendForm()
' this routine sends the message template contained in the control worksheet, with the attachment specified.

    'Application.ScreenUpdating = False



    Set iMsg = CreateObject("CDO.Message")
    Set iconf = CreateObject("CDO.Configuration")

    iconf.Load -1    ' CDO Source Defaults
    Set Flds = iconf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
        = Sheets("Sheet1").Range("B5").Text
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Update
    End With

    On Error GoTo failure
    
    With iMsg
        Set .Configuration = iconf
        .To = Sheets("Sheet1").Range("B6").Text
        .CC = Sheets("Sheet1").Range("B7").Text
        '        .BCC = WhoFrom
        .From = "testmail@blurbblurb.etc"
        .Subject = Sheets("Sheet1").Range("B8").Text
        .TextBody = Sheets("Sheet1").Range("B9").Text

' the .Send fails as the smtpserver name is invalid - this is by design
        .Send
    End With
    
    Set iMsg = Nothing
    Set iconf = Nothing
    MsgBox "Message sent"
    'Application.ScreenUpdating = True
    Exit Sub
failure:
    Application.ScreenUpdating = True
    Set iMsg = Nothing
    Set iconf = Nothing
    MsgBox "Error number " & Err.Number & Chr(13) & Chr(13) & Err.Description
    On Error GoTo -1 ' clear the error
End Sub
 

Attachments

  • 1610620464017.png
    1610620464017.png
    4.1 KB · Views: 0
  • 1610620508540.png
    1610620508540.png
    4.2 KB · Views: 0
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top