Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-13-2018, 09:54 PM
HuaMin HuaMin is offline Windows XP Office 2003
Banned
 
Join Date: Feb 2010
Posts: 6
HuaMin is on a distinguished road
Default Unable to run macro

Hi,


To the file below, why can't I run the macro inside it?
https://1drv.ms/x/s!Ai8CrEskdewXm1EtunChN-NFqXkj
Reply With Quote
  #2  
Old 11-13-2018, 10:34 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,110
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Instead of posting links to files elsewhere, please attach any files you'd like reviewed to a post here. You can do that via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 11-13-2018, 10:45 PM
HuaMin HuaMin is offline Windows XP Office 2003
Banned
 
Join Date: Feb 2010
Posts: 6
HuaMin is on a distinguished road
Default

Thanks. Attached is the relevant Excel file.
Attached Files
File Type: xlsm GSL_SI_1710160_1113145120.xlsm (69.0 KB, 1 views)
Reply With Quote
  #4  
Old 11-13-2018, 10:57 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,110
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

The macro runs just fine. The problem is with your logic: you loop through all Buttons, but there are no Buttons on the worksheet; what you have there is Shape objects with various names, some of which begin with 'Button'.

PS: Kindly update your userprofile to reflect the Operating System and Office version you're actually using; I seriously doubt it's Windows XP & Office 2003. And, for future reference, please also post threads in the appropriate forum - in this case the Excel Programming forum, to which I have now moved this thread.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 11-13-2018, 11:32 PM
HuaMin HuaMin is offline Windows XP Office 2003
Banned
 
Join Date: Feb 2010
Posts: 6
HuaMin is on a distinguished road
Default

Sorry, I got this error
https://1drv.ms/u/s!Ai8CrEskdewXm1QXfNbf5dR9oyAF

due to 2nd line below.

Dim btn As Shapes
For Each btn In ActiveSheet.Shapes
Debug.Print "Button " & btn.Name & " with caption " _
& btn.Caption & " Located at " & _
btn.TopLeftCell.Address
Next
Reply With Quote
  #6  
Old 11-14-2018, 01:15 AM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,110
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

As I already said, kindly post your attachments here, not elsewhere with links. You might also check what shape you're getting the error with - they don't all have captions...
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #7  
Old 11-14-2018, 01:34 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Windows 7 64bit Office 2010 64bit
Moderator
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,335
Pecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of lightPecoflyer is a glorious beacon of light
Default

Hi and welcome
Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.

Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

Do not post any further responses in this thread until a link has been provided to these cross posts.
__________________
Problem solved ? Let others know by clicking " Thread Tools" then " Mark thread as solved".( This can be undone if need be)
Want to thank for the help received ? Click the scales symbol in the upper right corner of a post from the person you want to thank.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to add new accounts robiom Outlook 0 11-30-2017 01:43 PM
Unable to record new Macro!! tesoke Excel Programming 2 11-16-2016 06:04 AM
Unable to open Outlook, receiving message unable to open because (myaccount)@gmail.c Flyin' Aces Tattoo Outlook 0 04-20-2013 11:56 AM
Unable to Print eweneek1 Word 1 05-21-2011 06:06 PM
Unable to run the specified macro jtrirogoff Word 0 02-05-2009 04:38 PM


All times are GMT -7. The time now is 01:44 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft