• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Not able to run the macro in other location

VARGEESH

Member
Hi,


I had created a macro file and saved on my desktop. It was working fine.


After i copied the file to my hard disk and tried to run the macro. It was thrown an error message stated that


[Cannot run the macro "C:UsersVargeeshDesktopFormatting_Template.xlsm'!selectfile. The macro may not be available in this workbook or all macros may be disabled.]


I have changed the macro security as "Enable all macros".


Can you please tell me what should i do to run the macro in any location of my computer and another computers.


Thanks!
 
Hi,

I dont know much about macros but I think the error has occured because you have referred to the file path somewhere in your code
 
Hi Vargeesh ,


The path of the macro is shown as :


C:UsersVargeeshDesktopFormatting_Template.xlsm'!selectfile


which means the file is expected to be on the Desktop , in the file named Formatting_Template.xlsm


If you have copied the file to your hard disk , open the Excel file , edit the file in the VB editor and change the path name given there to reflect the new location of your file.


If you are still not sure what to do , please mention the following :


1. The complete path of your file on your hard disk


2. The name of the Excel file which contains the macro you say is not executing from its present location.


Narayan
 
Hi Narayan/elhamdkh,


Thank you for your reply.


I didn't mentioned any path in my code.


The macro is running fine, If i choose under Developer > Macros.


But what i have done is, I have created a new Tab using


File > Options > Customize Ribbon > New Tab and then New Group.


After that i linked my macros to the new groups.


So that the user can use it like the excel menus.


Can you tell me what should i have to be done to avoid such error.


Please refer the file: http://www.2shared.com/file/iMu7c9iq/Formatting_Template.html


Thank you,

Vargeesh
 
Hi Vargeesh ,


When I run the selectfile macro from within the Formatting_Template.xlsm file , I don't get any error message ; can you say when you get an error ?


The settings I kept were :


1. Disable all macros except digitally signed macros


2. Trust access to the VBA project object model


Narayan
 
Hi, Vargeesh!


Regarding the time between your first and second comments in this topic (2 hours) I strongly suggest you to read the third green sticky post at this forums main page, specifically the 13th and 17th paragraphs.

"Consider that the world is operating 24hrs a day. A late post today may well be answered by someone else overnight."

"If you and a reader have been involved in an ongoing conversation and the conversation suddenly stops, recognize that the person may have gone to bed, even though you have just arrived at work. In the worst case a reader may go on holidays and not get back to the question for a few days."


And if it's about a hot theme that you have to solve as soon as possible, add the middle sentence of the 12th too.

"Never title your posts as "Urgent", "Priority" "Immediate". It may be Important to you, but not for rest of the members here. These words will be moderated out."


Regards!
 
Back
Top