Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Macro paths wrong after save

Hi all,

I'm working on a macro-loaded Workbook (that's shared via a SharePoint
site), and every time I open the workbook, make some changes, then do
a simple save (Ctrl+S, or File-Save), it works fine, but any macro I
try to run from a list on the Menu bar
(CommandBars(1).Controls("&Custom Macros)....) fails, saying that it
can't find the macro. The error message references the exact http
address of the file, and the name has not changed (it's a save, not a
save as).

I've searched this and other NG's furiously, and have only run into
*similar* situations in which the person was told to add add and
delete code to AfterOpen and BeforeClose events, which I've already
done. This is a totally unique problem, and, seeing as there's no
_clean_ AfterSave method, I'm in a bit of a bind. I'm still relatively
new to VBA -- learned it out of necessity for work.

Any help getting this menu to re-generate itself after a save or save
as (cleanly!) would be fantastic.

Many thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Macro paths wrong after save

Could you post some of the macro? That might help us.

"Kevin M" wrote:

Hi all,

I'm working on a macro-loaded Workbook (that's shared via a SharePoint
site), and every time I open the workbook, make some changes, then do
a simple save (Ctrl+S, or File-Save), it works fine, but any macro I
try to run from a list on the Menu bar
(CommandBars(1).Controls("&Custom Macros)....) fails, saying that it
can't find the macro. The error message references the exact http
address of the file, and the name has not changed (it's a save, not a
save as).

I've searched this and other NG's furiously, and have only run into
*similar* situations in which the person was told to add add and
delete code to AfterOpen and BeforeClose events, which I've already
done. This is a totally unique problem, and, seeing as there's no
_clean_ AfterSave method, I'm in a bit of a bind. I'm still relatively
new to VBA -- learned it out of necessity for work.

Any help getting this menu to re-generate itself after a save or save
as (cleanly!) would be fantastic.

Many thanks in advance.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Macro paths wrong after save

Sure. The following is contained in "ThisWorkbook" and generates the
menu that calls the macros defined in Module1

Sub MakeMenu()
Dim i As Integer
Dim arr1 As Variant, arr2 As Variant, arr3 As Variant

arr1 = Array("FitMergedCellHACK", "SelectForm", "SpecialSort")
arr2 = Array("Adjust Row Heights", "Send E-mail!", "Special Sort")
arr3 = Array(541, 24, 210)
With Application.CommandBars(1).Controls.Add(msoControl Popup)
.Caption = "&Custom Macros"
.TooltipText = "Select a macro from the list"
For i = 0 To 2
With .Controls.Add
.OnAction = arr1(i)
.Caption = arr2(i)
.FaceId = arr3(i)
End With
Next
End With
End Sub



On Apr 16, 6:32 pm, Barb Reinhardt
wrote:
Could you post some of the macro? That might help us.

"Kevin M" wrote:
Hi all,


I'm working on a macro-loaded Workbook (that's shared via a SharePoint
site), and every time I open the workbook, make some changes, then do
a simple save (Ctrl+S, or File-Save), it works fine, but any macro I
try to run from a list on the Menu bar
(CommandBars(1).Controls("&Custom Macros)....) fails, saying that it
can't find the macro. The error message references the exact http
address of the file, and the name has not changed (it's a save, not a
save as).


I've searched this and other NG's furiously, and have only run into
*similar* situations in which the person was told to add add and
delete code to AfterOpen and BeforeClose events, which I've already
done. This is a totally unique problem, and, seeing as there's no
_clean_ AfterSave method, I'm in a bit of a bind. I'm still relatively
new to VBA -- learned it out of necessity for work.


Any help getting this menu to re-generate itself after a save or save
as (cleanly!) would be fantastic.


Many thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Macro paths wrong after save

BTW, that is called from....

Sub Workbook_Open()
Call MakeMenu
End Sub

On Apr 17, 10:23 am, Kevin M wrote:
Sure. The following is contained in "ThisWorkbook" and generates the
menu that calls the macros defined in Module1

Sub MakeMenu()
Dim i As Integer
Dim arr1 As Variant, arr2 As Variant, arr3 As Variant

arr1 = Array("FitMergedCellHACK", "SelectForm", "SpecialSort")
arr2 = Array("Adjust Row Heights", "Send E-mail!", "Special Sort")
arr3 = Array(541, 24, 210)
With Application.CommandBars(1).Controls.Add(msoControl Popup)
.Caption = "&Custom Macros"
.TooltipText = "Select a macro from the list"
For i = 0 To 2
With .Controls.Add
.OnAction = arr1(i)
.Caption = arr2(i)
.FaceId = arr3(i)
End With
Next
End With
End Sub

On Apr 16, 6:32 pm, Barb Reinhardt

wrote:
Could you post some of the macro? That might help us.


"Kevin M" wrote:
Hi all,


I'm working on a macro-loaded Workbook (that's shared via a SharePoint
site), and every time I open the workbook, make some changes, then do
a simple save (Ctrl+S, or File-Save), it works fine, but any macro I
try to run from a list on the Menu bar
(CommandBars(1).Controls("&Custom Macros)....) fails, saying that it
can't find the macro. The error message references the exact http
address of the file, and the name has not changed (it's a save, not a
save as).


I've searched this and other NG's furiously, and have only run into
*similar* situations in which the person was told to add add and
delete code to AfterOpen and BeforeClose events, which I've already
done. This is a totally unique problem, and, seeing as there's no
_clean_ AfterSave method, I'm in a bit of a bind. I'm still relatively
new to VBA -- learned it out of necessity for work.


Any help getting this menu to re-generate itself after a save or save
as (cleanly!) would be fantastic.


Many thanks in advance.



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
This Macro halts any ideas what could be wrong pano Excel Worksheet Functions 4 February 24th 07 06:26 AM
Whats wrong with this macro please Mike Excel Discussion (Misc queries) 6 February 5th 06 09:31 PM
splitting names can't see whats going wrong (Save My Sanity ) workaholic Excel Worksheet Functions 5 November 8th 05 04:19 PM
splitting names can't see whats going wrong (Save My Sanity ) workaholic Excel Worksheet Functions 1 November 8th 05 02:09 AM
macro results wrong Joseph Tibiita Charts and Charting in Excel 2 June 30th 05 05:32 PM


All times are GMT +1. The time now is 04:07 PM.

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

About Us

"It's about Microsoft Excel"