Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2018, 09:54 PM
HuaMin HuaMin is offline Unable to run macro Windows XP Unable to run macro Office 2003
Banned
Unable to run macro
 
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 offline Unable to run macro Windows 7 64bit Unable to run macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-13-2018, 10:45 PM
HuaMin HuaMin is offline Unable to run macro Windows XP Unable to run macro Office 2003
Banned
Unable to run macro
 
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, 7 views)
Reply With Quote
  #4  
Old 11-13-2018, 10:57 PM
macropod's Avatar
macropod macropod is offline Unable to run macro Windows 7 64bit Unable to run macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-13-2018, 11:32 PM
HuaMin HuaMin is offline Unable to run macro Windows XP Unable to run macro Office 2003
Banned
Unable to run macro
 
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 offline Unable to run macro Windows 7 64bit Unable to run macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
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
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 11-14-2018, 01:34 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Unable to run macro Windows 7 64bit Unable to run macro Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,766
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
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.
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
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 run macro 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

Other Forums: Access Forums

All times are GMT -7. The time now is 05:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft