ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error document already opened (https://www.excelbanter.com/excel-programming/305808-error-document-already-opened.html)

jeffP

Error document already opened
 
Hi all,
I have a ss with a few macros. I run them from toolsmacros and from a
custom added menu bar item without problem. I also have a custom toolbar
with 5 buttons/ macros attached. When I try to run the macros from there I'm
getting an error message " A document with the name "Budget2005" is already
open. You cannot open two documents with the same name even if the documents
are in different folders, .........."blah,blah,blah.
I don't have two folders open, these macros used to work from this toolbar
and I'm stumped.
Any help , as always, would be greatly appreciated.


--
jeff




Tom Ogilvy

Error document already opened
 
for each ctl in Commandbars("Custom1")
msgbox ctl.OnAction
Next

would show you what macro is assigned to each. Make sure they point to the
correct workbook.

--
Regards,
Tom Ogilvy

"jeffP" wrote in message
...
Hi all,
I have a ss with a few macros. I run them from toolsmacros and from a
custom added menu bar item without problem. I also have a custom toolbar
with 5 buttons/ macros attached. When I try to run the macros from there

I'm
getting an error message " A document with the name "Budget2005" is

already
open. You cannot open two documents with the same name even if the

documents
are in different folders, .........."blah,blah,blah.
I don't have two folders open, these macros used to work from this toolbar
and I'm stumped.
Any help , as always, would be greatly appreciated.


--
jeff






jeffP

Error document already opened
 
Tom,
You were correct about checking where they pointed to. I used SaveAs to
back up the file in a different directory and somehow the macros assigned to
the cusstombar picked up the full path. I'm not sure how but anyway it's
fixed.
I tried to use your help w/ the for statement but get Run-time error 5
'invalid procedure or call' . I really don't understand the loop (where to
put it,etc) and would appreciate it if you could help me understand how to
use it and/or link me to somewhere that could teach me.
Thanks for all you help, always.

--
jeffP


"Tom Ogilvy" wrote in message
...
for each ctl in Commandbars("Custom1")
msgbox ctl.OnAction
Next

would show you what macro is assigned to each. Make sure they point to

the
correct workbook.

--
Regards,
Tom Ogilvy

"jeffP" wrote in message
...
Hi all,
I have a ss with a few macros. I run them from toolsmacros and from a
custom added menu bar item without problem. I also have a custom toolbar
with 5 buttons/ macros attached. When I try to run the macros from there

I'm
getting an error message " A document with the name "Budget2005" is

already
open. You cannot open two documents with the same name even if the

documents
are in different folders, .........."blah,blah,blah.
I don't have two folders open, these macros used to work from this

toolbar
and I'm stumped.
Any help , as always, would be greatly appreciated.


--
jeff








Tom Ogilvy

Error document already opened
 
had a typo in it

Sub ShowOnAction()

For Each ctl In CommandBars("Matrix").Controls
On Error Resume Next
MsgBox ctl.Caption & " - " & ctl.OnAction
On Error GoTo 0
Next
End Sub

Change Matrix to the name of your commandbar

--
Regards,
Tom Ogilvy






"jeffP" wrote in message
...
Tom,
You were correct about checking where they pointed to. I used SaveAs to
back up the file in a different directory and somehow the macros assigned

to
the cusstombar picked up the full path. I'm not sure how but anyway it's
fixed.
I tried to use your help w/ the for statement but get Run-time error 5
'invalid procedure or call' . I really don't understand the loop (where

to
put it,etc) and would appreciate it if you could help me understand how to
use it and/or link me to somewhere that could teach me.
Thanks for all you help, always.

--
jeffP


"Tom Ogilvy" wrote in message
...
for each ctl in Commandbars("Custom1")
msgbox ctl.OnAction
Next

would show you what macro is assigned to each. Make sure they point to

the
correct workbook.

--
Regards,
Tom Ogilvy

"jeffP" wrote in message
...
Hi all,
I have a ss with a few macros. I run them from toolsmacros and from a
custom added menu bar item without problem. I also have a custom

toolbar
with 5 buttons/ macros attached. When I try to run the macros from

there
I'm
getting an error message " A document with the name "Budget2005" is

already
open. You cannot open two documents with the same name even if the

documents
are in different folders, .........."blah,blah,blah.
I don't have two folders open, these macros used to work from this

toolbar
and I'm stumped.
Any help , as always, would be greatly appreciated.


--
jeff











All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com