Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
Please consider this code. I am looking for a solution to resolve the "Unable to set the Top property of the Window class" error I get with theline in red.
Note:
The activeworkbook is the second of two workbooks currenly open. It is properly being recognized as the "Activeworkbook"
This procedure is executed as part of the activeworkbook's activation of worksheet "Form"
Code in workbook had had opened this 2nd workbook and kept it hidden until at some time, code in workbook 1 revealed the hidden workbook, and activated worksheet "Form" thus triggering this code. The preferred outcomne is to have a size reduced workbook 2 window in front of workbook 1. The user then uses the interface provided in worksheet "Form" of workbook 2 to compile infomation needed for the code to proceed in workbook 1. The code in workbook 1 is stopped (with a stop command after worksheet "Form" had been activated) until data is entered. Watch for my next question ... how to resume stoped code?
I'm sure much of this can be avoided by using a userform in workbook 1. My logic is why reinvent something already working to do the same thing in another workbook (although not as a userform)? I may soon have an answer to that question.
Rich (BB code):
Public Sub ReadingView()
'Stop
With Application
With ActiveWorkbook
' store current ActiveWorkbook settings
View.drawingobjects = .DisplayDrawingObjects
'.DisplayDrawingObjects = xlHide
End With
With ActiveWindow
' store current ActiveWindow settings
View.headings = .DisplayHeadings
View.gridlines = .DisplayGridlines
View.hscrollbar = .DisplayHorizontalScrollBar
View.vscrollbar = .DisplayVerticalScrollBar
View.wkbtabs = .DisplayWorkbookTabs
View.windowstate = .windowstate
' set
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
.DisplayGridlines = False
'.windowstate = xlNormal
.Top = 25
.Left = 25
.Width = 500
.Height = 250
End With
' set
.ExecuteExcel4Macro _
"SHOW.TOOLBAR(""Ribbon"",False)"
' store current Application Settings
View.formulabar = .DisplayFormulaBar
View.statusbar = .DisplayStatusBar
'set
.DisplayFormulaBar = False
.DisplayStatusBar = False
End With
End Sub
Note:
The activeworkbook is the second of two workbooks currenly open. It is properly being recognized as the "Activeworkbook"
This procedure is executed as part of the activeworkbook's activation of worksheet "Form"
Code in workbook had had opened this 2nd workbook and kept it hidden until at some time, code in workbook 1 revealed the hidden workbook, and activated worksheet "Form" thus triggering this code. The preferred outcomne is to have a size reduced workbook 2 window in front of workbook 1. The user then uses the interface provided in worksheet "Form" of workbook 2 to compile infomation needed for the code to proceed in workbook 1. The code in workbook 1 is stopped (with a stop command after worksheet "Form" had been activated) until data is entered. Watch for my next question ... how to resume stoped code?
I'm sure much of this can be avoided by using a userform in workbook 1. My logic is why reinvent something already working to do the same thing in another workbook (although not as a userform)? I may soon have an answer to that question.