How can I set the size property of an OWC control?

diegoo

New Member
Joined
Dec 22, 2005
Messages
6
I am publishing a spreadsheet as an HTML page displayed using Office Web Components. Is there any way I can set the size of the page that is displayed? Actually, thinking about it the question really is: can I set the size of the OWC control on the client's system so that when they open the published page they will always see a set number of columns and rows? Any hlp with this is appreciated... :biggrin:
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

diegoo

New Member
Joined
Dec 22, 2005
Messages
6
This is how I resolved my problem. I first published the spreadsheet as a web page and the applied the following code.

Code:
[img]/intranet/images/icons/clear.gif[/img]
<SCRIPT language=vbscript>

Sub CustomizeToolbar()
   Dim tb
   Dim iCtr
   Dim sButtonName
   Dim ssConstants
    
   Const CMD_PREFIX = "owc"
    
   Set ssConstants = CompensationAS_18714_Spreadsheet.Constants

   ' Set a variable to the Spreadsheet control's toolbar.    
   Set tb = CompensationAS_18714_Spreadsheet.Toolbar
    
   ' Call a procedure that removes all commands from the toolbar.
   ClearToolbar tb
   CompensationAS_18714_Spreadsheet.DisplayHorizontalScrollBar = False
   CompensationAS_18714_Spreadsheet.DisplayVerticalScrollBar = false
   CompensationAS_18714_Spreadsheet.Height = 800
   CompensationAS_18714_Spreadsheet.Width = 450
   CompensationAS_18714_Spreadsheet.DisplayRowHeadings = false
   CompensationAS_18714_Spreadsheet.DisplayColumnHeadings = false
   CompensationAS_18714_Spreadsheet.DisplayToolbar = false
   CompensationAS_18714_Spreadsheet.DisplayTitleBar = false
   CompensationAS_18714_Spreadsheet.DisplayWorkbookTabs = false

   
   'Set a variable to the name of the Copy button. 
   'sButtonName = CMD_PREFIX & ssConstants.ocCommandCopy
   
   ' Add the Copy button ot the toolbar. 
   'tb.Buttons.Add tb.Buttons.Count + 1, sButtonName, , 0, sButtonName
   
   ' Set a variable to the name of the Paste button. 
   'sButtonName = "owc" & ssConstants.ocCommandPaste

   ' Add the Copy button ot the toolbar. 
   'tb.Buttons.Add tb.Buttons.Count + 1, sButtonName, , 0, sButtonName

End Sub

Sub ClearToolbar(Toolbar)

   For iCtr = 1 To Toolbar.Buttons.Count
       Toolbar.Buttons.Remove 1
   Next

End Sub

CompensationAS_18714_Spreadsheet.ActiveWindow.ScrollIntoView 0, 0, 0, 0


</SCRIPT>
 

Watch MrExcel Video

Forum statistics

Threads
1,118,436
Messages
5,572,104
Members
412,441
Latest member
kelethymos
Top