Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PROBLEM : Excel automatically updates the macro locations in the toolbar

Hi,

I encountered the following problem.
- Create a blank wordbook
- Add the following procedure in VBA
Public Sub test()
MsgBox ThisWorkbook.FullName
End Sub

- now create a custom toolbar and name it abc
- assign a button to it and assign the test procedure to the button Test
- save the workbook as test1
- press the Test button.
It should say C:\Test1.xls
- Quit excel
- Start excel but don't open the book
- Close any open workbook
- Press the Test button.
Excel will open the workbook and say C:\Test1.xls
- Now do File | save as and save the file as C:\test2.xls
- Press the Test button
It will now say C:\test2.xls while I was expecting C:\Test1.xls

Is there anyway to prevent this from happening ?
Is there a way to correct it ?
(I was thinking of programmatically reassign the marco's)
Is it possible to detach the toolbar from test2 by using VBA ?
If you do Tool | Customize | Attach you can copy/remove a toolbar into a workbook.
Unfortenately when you start recording, you get an empty macro.
Any idea how to do that fro VBA ?

With regards,

Constantijn Enders
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default PROBLEM : Excel automatically updates the macro locations in the toolbar

It seems to me that what you want is a macro in Personal.xls:
Public Sub test()
Workbooks.Open FileName:="D:\Test1.xls"
End Sub
Attach that to your toolbar button.
Now it always loads Test1, no matter how you save it.

(enders2010 wrote:
I encountered the following problem.
- Create a blank wordbook
- Add the following procedure in VBA
Public Sub test()
MsgBox ThisWorkbook.FullName
End Sub

- now create a custom toolbar and name it abc
- assign a button to it and assign the test procedure to the button Test
- save the workbook as test1
- press the Test button.
It should say C:\Test1.xls
- Quit excel
- Start excel but don't open the book
- Close any open workbook
- Press the Test button.
Excel will open the workbook and say C:\Test1.xls
- Now do File | save as and save the file as C:\test2.xls
- Press the Test button
It will now say C:\test2.xls while I was expecting C:\Test1.xls

Is there anyway to prevent this from happening ?
Is there a way to correct it ?
(I was thinking of programmatically reassign the marco's)
Is it possible to detach the toolbar from test2 by using VBA ?
If you do Tool | Customize | Attach you can copy/remove a toolbar into a workbook.
Unfortenately when you start recording, you get an empty macro.
Any idea how to do that fro VBA ?

With regards,

Constantijn Enders




----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changin a Macro so it automatically updates the active worksheet. Confused Laura Excel Discussion (Misc queries) 1 March 17th 08 11:19 PM
Excel automatically updates inserted date Jo Excel Worksheet Functions 3 January 9th 08 11:26 PM
Excel 2003 no longer automatically updates equations & charts bnault2006 Excel Discussion (Misc queries) 3 October 5th 07 02:55 PM
can you have excel automatically save in 2 locations Saving a Backup every time Excel Discussion (Misc queries) 6 September 30th 06 05:49 PM
Reassigning macro locations for toolbar buttons dm59 Excel Discussion (Misc queries) 3 January 12th 06 05:58 PM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"