bluewaterfree
New Member
- Joined
- Dec 6, 2020
- Messages
- 20
- Office Version
- 2019
- Platform
- Windows
I searched and read numerous similar threads but haven't solved my issue.
Here's my situation...
Macro-enabled workbook titled "Budget2020v15.xlsb".
Created a customized ribbon with buttons on it to switch worksheets and automatically format. Here's one example..
Sub NextDiscover()
'
' NextDiscover Macro
'
' Set Screen Size Narrow Width and Full Height
Call ScreenSize(1280, 780, 0, 0)
' Activate Worksheet
Worksheets("Actual Income Expenses").Activate
' Set Column Widths
Call Set_Column_Width("A", 15)
Call Set_Column_Width("B", 15)
Call Set_Column_Width("C", 15)
Call Set_Column_Width("D", 15)
Call Set_Column_Width("E", 15)
Call Set_Column_Width("F", 15)
Call Set_Column_Width("G", 15)
Call Set_Column_Width("H", 15)
Call Set_Column_Width("I", 15)
Call Set_Column_Width("J", 37)
Call Set_Column_Width("K", 28)
Call Set_Column_Width("L", 0)
Call Set_Column_Width("M", 15)
Call Set_Column_Width("N", 11)
Call Set_Column_Width("O", 11)
Call Set_Column_Width("P", 37)
Call Set_Column_Width("Q", 11)
Call Set_Column_Width("R", 20)
Call Set_Column_Width("S", 14)
Call Set_Column_Width("T", 3)
'Set Row Heights
Rows("1:9999").RowHeight = 15
'Select Starting Upper Left Cell to View
ActiveWindow.Panes(1).Activate
Call Cell_Select("J", 1, True)
'Select Starting Cell to Edit
Dim NextBlankRow As Integer
ActiveWindow.Panes(4).Activate
NextBlankRow = WorksheetFunction.Match("BLANK", Range("M3070:M9999"), 0) + 3069
Call Cell_Select("N", NextBlankRow, True)
End Sub
Sub ScreenSize(Width As Integer, Height As Integer, Top As Integer, Left As Integer)
' Sets position and size of Excel Screen
Application.WindowState = xlNormal
Application.Width = Width
Application.Height = Height
Application.Top = Top
Application.Left = Left
End Sub
Sub Set_Column_Width(Row As String, Width As Integer)
Columns(Row & ":" & Row).Select
Selection.ColumnWidth = Width
End Sub
Sub Cell_Select(Column As String, Row As Integer, Scroll As Boolean)
Range(Column & Row).Select
Application.Goto Range(Column & Row), Scroll:=Scroll
End Sub
The workbook is stored in D:\Documents\Finances
Everything works fine.
On the same computer, I "Save As" to a different location.... example E:\ with the same file name. I then close Excel completely... even restart the computer. I then open the file from E:\. The file opens fine. When I hit the button associated NextDiscover, I get the error "Sorry, Excel can't open two workbooks with the same name at the same time."
It's on the same computer.... there's only one workbook open... I don't see anything trying to open a second workbook....
Help please!!
Here's my situation...
Macro-enabled workbook titled "Budget2020v15.xlsb".
Created a customized ribbon with buttons on it to switch worksheets and automatically format. Here's one example..
Sub NextDiscover()
'
' NextDiscover Macro
'
' Set Screen Size Narrow Width and Full Height
Call ScreenSize(1280, 780, 0, 0)
' Activate Worksheet
Worksheets("Actual Income Expenses").Activate
' Set Column Widths
Call Set_Column_Width("A", 15)
Call Set_Column_Width("B", 15)
Call Set_Column_Width("C", 15)
Call Set_Column_Width("D", 15)
Call Set_Column_Width("E", 15)
Call Set_Column_Width("F", 15)
Call Set_Column_Width("G", 15)
Call Set_Column_Width("H", 15)
Call Set_Column_Width("I", 15)
Call Set_Column_Width("J", 37)
Call Set_Column_Width("K", 28)
Call Set_Column_Width("L", 0)
Call Set_Column_Width("M", 15)
Call Set_Column_Width("N", 11)
Call Set_Column_Width("O", 11)
Call Set_Column_Width("P", 37)
Call Set_Column_Width("Q", 11)
Call Set_Column_Width("R", 20)
Call Set_Column_Width("S", 14)
Call Set_Column_Width("T", 3)
'Set Row Heights
Rows("1:9999").RowHeight = 15
'Select Starting Upper Left Cell to View
ActiveWindow.Panes(1).Activate
Call Cell_Select("J", 1, True)
'Select Starting Cell to Edit
Dim NextBlankRow As Integer
ActiveWindow.Panes(4).Activate
NextBlankRow = WorksheetFunction.Match("BLANK", Range("M3070:M9999"), 0) + 3069
Call Cell_Select("N", NextBlankRow, True)
End Sub
Sub ScreenSize(Width As Integer, Height As Integer, Top As Integer, Left As Integer)
' Sets position and size of Excel Screen
Application.WindowState = xlNormal
Application.Width = Width
Application.Height = Height
Application.Top = Top
Application.Left = Left
End Sub
Sub Set_Column_Width(Row As String, Width As Integer)
Columns(Row & ":" & Row).Select
Selection.ColumnWidth = Width
End Sub
Sub Cell_Select(Column As String, Row As Integer, Scroll As Boolean)
Range(Column & Row).Select
Application.Goto Range(Column & Row), Scroll:=Scroll
End Sub
The workbook is stored in D:\Documents\Finances
Everything works fine.
On the same computer, I "Save As" to a different location.... example E:\ with the same file name. I then close Excel completely... even restart the computer. I then open the file from E:\. The file opens fine. When I hit the button associated NextDiscover, I get the error "Sorry, Excel can't open two workbooks with the same name at the same time."
It's on the same computer.... there's only one workbook open... I don't see anything trying to open a second workbook....
Help please!!