View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default repost: error 'document already opened'

Just a guess, but I wonder what the buttons pointed to before you saved it in
either spot.

(I'm guessing faulty testing <bg.)

jeffP wrote:

Hi Dave,
I use John's MenuMaker and it's terrific! I was supplimenting w/ a custom
toolbar (same macros mostly) when I ran into this problem. I'm still
confused. I save the original file /path (C:\2005\budget.xls) then SaveAs
C:\2005\backup\budget.xls. If I open either file , macros run from the
custom toolbar BOTH point to the copy in the backup directory. It seems
that the file in the backup directory would point there, but the original
would point to C:\2005\budget.xls ? No?
I'll try the other link you provided and go from there.
Thanks,
jeffP

"Dave Peterson" wrote in message
...
When you saved the workbook that contained the macros for the toolbar to a

new
location, then the buttons in pointed at the new file location.

So now you have two identical looking buttons (created from two different
workbooks) that point at different workbooks.

You could either reassign the macros for each button in the new toolbar or

maybe
a little more work to start (but easier later on), would be to create the
toolbar on the fly--when you open the workbook with the macros.

John Walkenbach has a nice workbook that actually creates another option

on the
worksheet menubar.
http://j-walk.com/ss/excel/tips/tip53.htm

It's called menumaker. It's really simple to use and looks very
nice/professional.

If I want a toolbar, I use this as my starting point when I'm building

toolbars:
http://groups.google.com/groups?thre...5B41%40msn.com

jeffP wrote:

Trying to run a macro from a custom toolbar I get the error
"A document with the name "myworkbook" is already open. You cannot open

two
documents .....blah,blah,blah.
This error is happening w/ my custom toolbar. I have a few macros that

run
from ToolMacro ,a custom menu bar item and a custom toolbar just fine.
But, if I save the workbook w/ SaveAs to another directory (same

filename)
for backup I cause a problem. When I re-open the original workbook and

try
to run macros from the custom toolbar I get the above error. It's

because
the path has been changed and points to the directory where the backup

was
put. This doesn't affect the macro, nor running the macros from the menu

bar
. Just the custom toolbar. I have the following code for opening the

toolbar
w/ Workbook_Open event

With Application
.CommandBars("BudgetBar").Visible = True
additional code
end with

and this with Workbook_BeforeClose
Application.CommandBars("BudgetBar").Visible = False

I'm thinking it's because the object is Application and should be

something
smaller (workbook?) but I"m obviously confused and any and all help is
always appreciated.
--
jeff


--

Dave Peterson


--

Dave Peterson