Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Column width reset

I have just started to experience a very strange problem that
hopefully someone may recognise.

Note that this only happening on my machine and the code runs
perfectly well on other machines . The problem has only come to light
since our support desk made a change to my Windows profile. The
problem may be caused by this change but I am hoping expert Excel
resources may be able to help explain the problem.

I have code to populate worksheets with data, within which I check for
pagebreaks and add lines and text to get around natural constraints
that Excel has for page headers. However, when I run the following
line (even if this returns False) Excel changes the column widths of
columns to a large random value (usually 255 pts)

If Worksheets(strsheetname).Rows(introw).PageBreak < xlNone Then

In have stepped through the code and actually can see the worksheet
format change as this line is processed.

Thanks for any feedback.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Column width reset

I have no idea why it would cause this problem but since you've had your
profile changed and because it involves printing, I'd suggest seeing what
happens if you change to another printer. Even a pretend one like Adobe or
MS XPS in the File, Print dialog.

--
Jim
"Andy Thomas" wrote in message
...
|I have just started to experience a very strange problem that
| hopefully someone may recognise.
|
| Note that this only happening on my machine and the code runs
| perfectly well on other machines . The problem has only come to light
| since our support desk made a change to my Windows profile. The
| problem may be caused by this change but I am hoping expert Excel
| resources may be able to help explain the problem.
|
| I have code to populate worksheets with data, within which I check for
| pagebreaks and add lines and text to get around natural constraints
| that Excel has for page headers. However, when I run the following
| line (even if this returns False) Excel changes the column widths of
| columns to a large random value (usually 255 pts)
|
| If Worksheets(strsheetname).Rows(introw).PageBreak < xlNone Then
|
| In have stepped through the code and actually can see the worksheet
| format change as this line is processed.
|
| Thanks for any feedback.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Column width reset

Thanks Jim, though printing isn't involved. This behaviour occurs
when formatting data on a spreadsheet.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Column width reset

Andy-

I know you weren't print. That's not the point. Excel uses the print
driver internally anytime you do something involving printing, like setting
page breaks.

--
Jim
"Andy Thomas" wrote in message
...
| Thanks Jim, though printing isn't involved. This behaviour occurs
| when formatting data on a spreadsheet.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Column width reset

Thanks Jim - I've changed printers and this has sorted it. Thanks
again.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted columns reset their width to zero Dave O Excel Discussion (Misc queries) 4 October 30th 08 12:10 AM
Create a macro which takes a column name and width and sets the column width to what it should be Ag Excel Programming 4 September 29th 07 11:29 PM
How to make cell width different than the column width it lies in John Excel Discussion (Misc queries) 2 September 11th 06 10:41 PM
Set Column Width Based On Total Width Of Other Columns rayneraingoaway Excel Programming 1 June 28th 06 11:10 PM


All times are GMT +1. The time now is 09:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"