Error when file moved

bluewaterfree

New Member
Joined
Dec 6, 2020
Messages
13
Office Version
  1. 2019
Platform
  1. 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!!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,526
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Watch MrExcel Video

Forum statistics

Threads
1,127,535
Messages
5,625,387
Members
416,099
Latest member
sudarsan23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top