+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
Office Software Thread, Excel "Fit to Pages Wide" Too Small in Technical; Originally Posted by TechMonkey AS I said I have found all kinds of windedness with the defaults from SIMS. It ...
  1. #16

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,771
    Thank Post
    1,511
    Thanked 1,294 Times in 884 Posts
    Rep Power
    813
    Quote Originally Posted by TechMonkey View Post
    AS I said I have found all kinds of windedness with the defaults from SIMS. It sometimes seems to be whatever defaults the last person to work on the template/macro/programming at Capita had get shipped. That is the only reason I can see why we have things like automatic calculation turned off on spreadsheets and some templates coming out in weird views or zoom settings (such as two page spread or normal view).
    It's just one more little annoyance I'll have to learn to live with by the looks of it!

    If anybody is interested, here's the final script. It'll let you drag a folder full of SIMS exported marksheets (doesn't matter whether they're XML or been converted to XLS) and will print them all on one side of A4 in landscape. It's basic but it'll save someone a job if they decide to do the same! The only caveat is they probably have to be exported unformatted or the neccessary editing might be blocked (I haven't tried it so I could be wrong)

    Code:
    Option Explicit
    
    Dim Arg 			'Script argument
    Dim FSO			'File System Object
    Dim oFol			'Folder object
    Dim oFil			'File object
    Dim oFils		'Files
    Dim myExcel		'Excel object
    Dim myWorkbook		'Workbook object
    Dim mySheet			'new worksheet
    Dim filePath	'Path to file (need for Excel to open the file)
    
    
    'Check arguments
    If WScript.Arguments.Length < 1 Then
    	MsgBox "Drag a folder containing Excel XML files onto this script", vbOKOnly, "Error!"
    	WScript.Quit
    End If 
    
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Arg = WScript.Arguments(0)
    If FSO.FolderExists(Arg) = False Then
       MsgBox "Drag and drop a folder onto this script to print the contents."
       Set FSO = Nothing
       WScript.Quit
    End If
    
    Set myExcel = CreateObject("Excel.Application")
    myExcel.Visible = True
    
    'Get folder informaton
    Set oFol = FSO.GetFolder(Arg)
    
    Set oFils = oFol.Files
       For Each oFil in oFils  '-- enumerate files in the folder using For/Each. Each oFil is a File object.
    	filePath = oFil
    	Set myWorkbook = myExcel.Workbooks.Open(filePath)
    	
    	Set mySheet = myWorkbook.Sheets.Add()
    	
    	myWorkbook.Sheets("Sheet1").UsedRange.Copy
    	mySheet.Range("A1").PasteSpecial
    	mySheet.Cells.Font.Size = 14
    	mySheet.Cells.EntireColumn.AutoFit
    	mySheet.Columns("A").ColumnWidth = mySheet.Columns("A").ColumnWidth / 2
        	
    	With mySheet.PageSetup
    		.PrintArea = mySheet.UsedRange.Address
    		.Orientation = 2
    		.LeftMargin = myExcel.Application.InchesToPoints(0.25)
    		.RightMargin = myExcel.Application.InchesToPoints(0.25)
    		.TopMargin = myExcel.Application.InchesToPoints(0.75)
    		.BottomMargin = myExcel.Application.InchesToPoints(0.75)
    		.Zoom = False
    		.FitToPagesWide = 1
    	End With
    	mySheet.PrintOut
    	myWorkbook.Close False
    	Set mySheet = Nothing
    	Set myWorkbook = Nothing
       Next 
    myExcel.Application.Quit
    Set myExcel = Nothing
    Set oFils = Nothing
    Set oFol = Nothing

  2. #17

    Join Date
    Feb 2009
    Posts
    150
    Thank Post
    0
    Thanked 36 Times in 35 Posts
    Rep Power
    18
    Has your text size been changed to something small, using 1 page wide by 1 page tall will not zoom above 100% it will only reduce size to fit (at least in excel 2003 it doesn't).

  3. #18

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,771
    Thank Post
    1,511
    Thanked 1,294 Times in 884 Posts
    Rep Power
    813
    Quote Originally Posted by HilcrRWise View Post
    Has your text size been changed to something small, using 1 page wide by 1 page tall will not zoom above 100% it will only reduce size to fit (at least in excel 2003 it doesn't).
    No that wasn't it, it's solved now



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [MS Office - 2010] Excel - Convert text to lowercase
    By FunkMaster_J in forum Office Software
    Replies: 7
    Last Post: 2nd June 2011, 11:45 PM
  2. A good introduction to virtualisation webinar - free too
    By CC1010 in forum Thin Client and Virtual Machines
    Replies: 12
    Last Post: 2nd November 2010, 11:15 AM
  3. excel date field to general numbers
    By djones in forum Scripts
    Replies: 3
    Last Post: 4th August 2009, 10:51 AM
  4. Moodle Scorm Player too small for content
    By j17sparky in forum Virtual Learning Platforms
    Replies: 5
    Last Post: 11th November 2008, 07:59 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •