[Solved] Disabling Scroll Down on my SpreadSheet
[Solved] Disabling Scroll Down on my SpreadSheet
Is it possible to create a macro to avoid someone to scroll down on my spreadsheet?
Last edited by Hagar Delest on Sat Jul 01, 2017 10:00 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 4.1.3 on Arch Linux
Re: Disabling Scroll Down on my SpreadSheet
Probably you will get a helpful answer if you tell what you finally want to achieve.
After all you yourself also are "someone", and you surely would want to be able to scroll down if needed, wouldn't you?
After all you yourself also are "someone", and you surely would want to be able to scroll down if needed, wouldn't you?
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Disabling Scroll Down on my SpreadSheet
I'm making a spreadsheet that has push buttons and text fields, It present the data in without showing the Scroll Bars, Menu Bar, Tool Bars and Status Bar.
So, It will act like a data app viewer, that's why I want to create a macro to disable the scroll.
In Excel VBA, I was using this macro:
But now I'm porting all my job, so, basically, I want the samething that will do the same when I select the Sheet1, for example.
So, It will act like a data app viewer, that's why I want to create a macro to disable the scroll.
In Excel VBA, I was using this macro:
Code: Select all
Sub blockscroll()
Sheets("Sheet1").ScrollArea = "$A$1:$N$40"
End SubOpenOffice 4.1.3 on Arch Linux
Re: Disabling Scroll Down on my SpreadSheet
Do the users need to enter information? If not, you could Protect the sheet.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
Re: Disabling Scroll Down on my SpreadSheet
Yes, they will have text boxes and some cells will be avaliable to change.
OpenOffice 4.1.3 on Arch Linux
Re: Disabling Scroll Down on my SpreadSheet
Sheets are objects of the same type as any CellRange in Calc. There will not be a property like 'ScrollAtrea' therefore.
Instead of restricting the scrollable Area you may hide columns and/or rows outside a specific CellRange which will also prevent scrolling thereto.
I still do not understand for what reason this must be done by a "macro". Why not simply save the doc with the amputated sheet?
If it must be done with a Sub the following one coded in OpenOffice BASIC should do.
Instead of restricting the scrollable Area you may hide columns and/or rows outside a specific CellRange which will also prevent scrolling thereto.
I still do not understand for what reason this must be done by a "macro". Why not simply save the doc with the amputated sheet?
If it must be done with a Sub the following one coded in OpenOffice BASIC should do.
Code: Select all
REM ***** BASIC *****
Sub SetVisibleRange(Optional pVisibleRange As String)
REM Set the default VisibleRange:
If IsMissing(pVisibleRange) Then pVisibleRange = "Sheet1.$A$1:$N$40"
theDoc = ThisComponent
theSheet = theDoc.Sheets.GetByName(Split(pVisibleRange, ".")(0))
theRange = theSheet.GetCellRangeByName(Split(pVisibleRange, ".")(1))
theSheet.Columns.IsVisible = False
theRange.Columns.IsVisible = True
If theRange.RangeAddress.StartRow>0 Then
theRangeH = theSheet.GetCellRangeByPosition(0, 0 , 0 , theRange.RangeAddress.StartRow - 1)
theRangeH.Rows.IsVisible = False
End If
If theRange.RangeAddress.EndRow<theSheet.RangeAddress.EndRow Then
theRangeH = theSheet.GetCellRangeByPosition(0, theRange.RangeAddress.EndRow + 1, 0, theSheet.RangeAddress.EndRow)
theRangeH.Rows.IsVisible = False
End If
End SubOn Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Disabling Scroll Down on my SpreadSheet
A macro is overkill. Prepare your document with hidden rows and columns. If you need multiple documents in this style, use a template.Tarkovsky wrote:Is it possible to create a macro to avoid someone to scroll down on my spreadsheet?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Disabling Scroll Down on my SpreadSheet
I'm sorry, that's because I was porting my existing code do OpenOffice/LibreOffice. Then I thought it would be possible to achieve this results only by a macro.Why not simply save the doc with the amputated sheet?
But your answers helped me a lot, thank you very much, It worked exactly the way I was looking for.
OpenOffice 4.1.3 on Arch Linux