Wednesday, July 6, 2016

Solution to Problem: Assign Macro to Button Excel 2010

Assign Macro to Button Excel 2010

I'll try to keep this as short as possible, so let me cut straight to the point.

I run a report that automatically sends out an email with certain sheets from a "master spreadsheet".
The main sheet that is sent out contains an "Update Spreadsheet" button for the users to update the info on the second sheet based on a macro I have attached to the button.

Here is the issue:
For some odd reason the "Macro name:" has automatically been shortening to a relative path and therefore has been rendered inoperable by the end users. 

For instance, instead of the "Macro name:" field holding the path of "  'Z:\ABC123\Folder1\Test.xls'!Update
it shortens to "  'Test.xls'!Update  whenever I click "OK" to finalize the change.
 
Is their any known way to force the button to keep the absolute path and not become shortened to the relative version?

I've researched and it doesn't appear that this error is very common.
 
(P.S.
This error began whenever I switched to Office 2010 from office 2007 and applied a simple correction to one of the sheets, but had to resave it)
(Also - if I go the the end users machines and manually change the macro name to the absolute path, the button works)
 
Thank you kindly and a happy new year!

-JM

Solutions to the Problem Assign Macro to Button Excel 2010

Download SmartPCFixer for Free Now

Is their any way to keep that from happening?

No.


But you know that the file is open if there is no path, so you can look into the Workbooks collection, get the right workbook directly.
And you can get the path from the workbook too, it's a property of the workbook.

The function below might be helpful.

Andreas.

Function GetWorkBook(ByVal WorkBookName As String) As Workbook
  'Return the workbook that name begins with or is WorkBookName, Nothing if not open
  Dim fso As Object 'FileSystemObject
  Set fso = CreateObject("Scripting.FileSystemObject")
  'Path given?
  If Len(fso.GetParentFolderName(WorkBookName)) > 0 Then
    'Compare the full path of each open workbook
    For Each GetWorkBook In Workbooks
      If StrComp(GetWorkBook.FullName, WorkBookName, vbTextCompare) = 0 Then
        Exit Function
      End If
    Next
  ElseIf InStrRev(WorkBookName, ".") > 0 Then
    'We must exact match if an extension is given
    On Error GoTo ExitPoint
    Set GetWorkBook = Workbooks(WorkBookName)
  Else
    'Without an extension it can be a new file too
    On Error GoTo SearchIt
    Set GetWorkBook = Workbooks(WorkBookName)
    Exit Function
SearchIt:
    On Error GoTo ExitPoint
    For Each GetWorkBook In Workbooks
      If StrComp(fso.GetBaseName(GetWorkBook.Name), WorkBookName, vbTextCompare) = 0 Then
        Exit Function
      End If
    Next
  End If
ExitPoint:
End Function

This particular error can easily be resolved with a few simple steps. However, if you are not confident in your ability to use the methods below or they do not fully remove the issue on your computer, you may want to seek the assistance of a qualified repair technician who is well versed in fixing Assign Macro to Button Excel 2010.

  1. Back-up the Registry of your operating system.
  2. Find the Registry Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade]
  3. Note: this Registry Key should already exist, if it does not exist, create it.
  4. Create a brand new DWORD Value that is named AllowOsUpdate
  5. Set the Value to 0x00000001.
  6. Close and reopen your Control Panel.
  7. Restart the Microsoft Windows.

Recommended Method to Fix the Problem: Assign Macro to Button Excel 2010:

How to Fix Assign Macro to Button Excel 2010 with SmartPCFixer?

1. Download SmartPCFixer. Install it on your system.

2. After the scan is finished, you can see the errors and problems which need to be fixed.

3. The Repair part is done, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in SmartPCFixer. Like dll downloading, junk file cleaning and print spooler error repair.


Related: AMD Radeon HD 7800M Win8 not working [Anwsered],I can access the internet, get on facebook and get to hotmail, but I can't play games on facebook and I can't open or respond to my e-mails,I keep getting this Media Player error when I log on my computer. [Anwsered],[Anwsered] System Hanging on shutdown and restart,Unable to get the Vlookup property of the WorksheetFunction class,Solution to Error: Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive.
,Troubleshoot:External Hard Drive not listed in Windows 7 backup wizard Error
,I'm always being signed off so annoying Tech Support
,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.
,Solution to Problem: Referencing data in another file
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22)
Read More: Solution to Error: Auto-populating text from multiple drop down boxes to start creating information in a new column,average of in a row range gives zero 0,backup and restore to VIRTUAL MACHINE [Solved],How to Fix Problem - Are there settings I can change either on my computer or in Windows Live so it runs faster??,How Can I Fix - Automatic row formatting?,application not found error,any problems in a team where one has Windows XP and the other has Windows 7?,Application/Object-Defined Error,An Excel formula question where hours are totalled and cumulating,Anyone know the hardware email?

No comments:

Post a Comment