Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Macro binding

Ok here it's not a question about making a macro it's about binding it
on the toolbar or custom toolbar to prevent the bug i'm having.

Here's the problem :
I made a vba code in a module that take the selected image and give it
a left/top/width position and add border to it, i work pretty well. The
problem is when i add it to the toolbar
here are my steps, Click on the kind of arrow and select add/remove
button i select in the second tab macro, after i right click on the
brand new macro icon and i go on affect new macro(i guess it's that in
english my excel is in french well it's the bottom one) and after in
the bottom in macro in : i select current document and i see my macro,
i select it and click ok everywhere and bang it's there, i save it
close reopen, and it work. now the problem appear when i make a copy of
this file, the macro like i add it still pointing to the original if i
delete the original file it say something like excelfile1.xls!mymacro
cannot be found bla bla bla. Is there a way to keep the button binded
to the current project macro. is there any vba function to rebind it
eachtime, go for solution im a vb developper i can understand anything.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Excel Macro binding

There must be a reference in your macro to the original file name. If so,
change it so that if references the filename in which it resides and it
should run OK. Otherwise, I don't Know what could be the problem.

"Franck" wrote:

Ok here it's not a question about making a macro it's about binding it
on the toolbar or custom toolbar to prevent the bug i'm having.

Here's the problem :
I made a vba code in a module that take the selected image and give it
a left/top/width position and add border to it, i work pretty well. The
problem is when i add it to the toolbar
here are my steps, Click on the kind of arrow and select add/remove
button i select in the second tab macro, after i right click on the
brand new macro icon and i go on affect new macro(i guess it's that in
english my excel is in french well it's the bottom one) and after in
the bottom in macro in : i select current document and i see my macro,
i select it and click ok everywhere and bang it's there, i save it
close reopen, and it work. now the problem appear when i make a copy of
this file, the macro like i add it still pointing to the original if i
delete the original file it say something like excelfile1.xls!mymacro
cannot be found bla bla bla. Is there a way to keep the button binded
to the current project macro. is there any vba function to rebind it
eachtime, go for solution im a vb developper i can understand anything.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Macro binding

the macro :

Public Sub Formatimage()
=========================================
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 4.5
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineThinThick
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 32
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

Dim mypic As Shape
For Each mypic In ActiveSheet.Shapes
mypic.Left = 70
mypic.Top = 332
mypic.Width = 320
Next

End Sub
==================================================

JLGWhiz a écrit :

There must be a reference in your macro to the original file name. If so,
change it so that if references the filename in which it resides and it
should run OK. Otherwise, I don't Know what could be the problem.

"Franck" wrote:

Ok here it's not a question about making a macro it's about binding it
on the toolbar or custom toolbar to prevent the bug i'm having.

Here's the problem :
I made a vba code in a module that take the selected image and give it
a left/top/width position and add border to it, i work pretty well. The
problem is when i add it to the toolbar
here are my steps, Click on the kind of arrow and select add/remove
button i select in the second tab macro, after i right click on the
brand new macro icon and i go on affect new macro(i guess it's that in
english my excel is in french well it's the bottom one) and after in
the bottom in macro in : i select current document and i see my macro,
i select it and click ok everywhere and bang it's there, i save it
close reopen, and it work. now the problem appear when i make a copy of
this file, the macro like i add it still pointing to the original if i
delete the original file it say something like excelfile1.xls!mymacro
cannot be found bla bla bla. Is there a way to keep the button binded
to the current project macro. is there any vba function to rebind it
eachtime, go for solution im a vb developper i can understand anything.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Macro binding

I did this following thing that the MVP said :

http://groups.google.ca/group/micros...74fb08d5f5a55e

the problem is nearly the same except it's happening when im copying
the file localy or remotely

Myfile.xls
- macro use the macro in Myfile.xls

Copy of Myfile.xls
- macro use the macro of Myfile.xls

i have tried to remove the toolbar at exit and recreate it at startup
but the button appear and when i click it ask to wich macro i want it
to run, i can't let it like that the user must not have this popup.


Franck wrote:
the macro :

Public Sub Formatimage()
=========================================
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 4.5
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineThinThick
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 32
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

Dim mypic As Shape
For Each mypic In ActiveSheet.Shapes
mypic.Left = 70
mypic.Top = 332
mypic.Width = 320
Next

End Sub
==================================================

JLGWhiz a écrit :

There must be a reference in your macro to the original file name. If so,
change it so that if references the filename in which it resides and it
should run OK. Otherwise, I don't Know what could be the problem.

"Franck" wrote:

Ok here it's not a question about making a macro it's about binding it
on the toolbar or custom toolbar to prevent the bug i'm having.

Here's the problem :
I made a vba code in a module that take the selected image and give it
a left/top/width position and add border to it, i work pretty well. The
problem is when i add it to the toolbar
here are my steps, Click on the kind of arrow and select add/remove
button i select in the second tab macro, after i right click on the
brand new macro icon and i go on affect new macro(i guess it's that in
english my excel is in french well it's the bottom one) and after in
the bottom in macro in : i select current document and i see my macro,
i select it and click ok everywhere and bang it's there, i save it
close reopen, and it work. now the problem appear when i make a copy of
this file, the macro like i add it still pointing to the original if i
delete the original file it say something like excelfile1.xls!mymacro
cannot be found bla bla bla. Is there a way to keep the button binded
to the current project macro. is there any vba function to rebind it
eachtime, go for solution im a vb developper i can understand anything.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Excel Macro binding

anyone got a hint please still havent found

Franck wrote:
I did this following thing that the MVP said :

http://groups.google.ca/group/micros...74fb08d5f5a55e

the problem is nearly the same except it's happening when im copying
the file localy or remotely

Myfile.xls
- macro use the macro in Myfile.xls

Copy of Myfile.xls
- macro use the macro of Myfile.xls

i have tried to remove the toolbar at exit and recreate it at startup
but the button appear and when i click it ask to wich macro i want it
to run, i can't let it like that the user must not have this popup.


Franck wrote:
the macro :

Public Sub Formatimage()
=========================================
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 4.5
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineThinThick
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 32
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)

Dim mypic As Shape
For Each mypic In ActiveSheet.Shapes
mypic.Left = 70
mypic.Top = 332
mypic.Width = 320
Next

End Sub
==================================================

JLGWhiz a écrit :

There must be a reference in your macro to the original file name. If so,
change it so that if references the filename in which it resides and it
should run OK. Otherwise, I don't Know what could be the problem.

"Franck" wrote:

Ok here it's not a question about making a macro it's about binding it
on the toolbar or custom toolbar to prevent the bug i'm having.

Here's the problem :
I made a vba code in a module that take the selected image and give it
a left/top/width position and add border to it, i work pretty well. The
problem is when i add it to the toolbar
here are my steps, Click on the kind of arrow and select add/remove
button i select in the second tab macro, after i right click on the
brand new macro icon and i go on affect new macro(i guess it's that in
english my excel is in french well it's the bottom one) and after in
the bottom in macro in : i select current document and i see my macro,
i select it and click ok everywhere and bang it's there, i save it
close reopen, and it work. now the problem appear when i make a copy of
this file, the macro like i add it still pointing to the original if i
delete the original file it say something like excelfile1.xls!mymacro
cannot be found bla bla bla. Is there a way to keep the button binded
to the current project macro. is there any vba function to rebind it
eachtime, go for solution im a vb developper i can understand anything.



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
Email Macro Late Binding Jan Holmstrom Excel Programming 8 June 8th 05 07:33 PM
Late Binding examples of binding excel application HeatherO Excel Programming 13 March 17th 05 08:19 AM
late binding in excel Grey Excel Programming 2 May 24th 04 08:26 AM
late binding in excel Grey Excel Programming 3 May 22nd 04 05:15 PM
EARLY binding or LATE binding ? jason Excel Programming 6 February 26th 04 04:57 PM


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

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"