This version of Excel will not run Macros

stuartgb100

Active Member
Joined
May 10, 2015
Messages
322
Office Version
  1. 2021
Platform
  1. Windows
Hi,

With a lot of help, I now have a working routine. Thanks.
The routine was designed to work on an android smartphone running 365.
I found out soon that macros are not supported, so I had to work around that limitation,
and then save the workbook as a .xlsx file (without code).
It seemed to work, but then I found this problem:

When a hyperlink is clicked in the .xlsm version, it displays the relevent worksheet, and I use this given code to make
the cell being linked at the top of the window:

VBA Code:
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink)
    'to set the target row to display
    'Application.Goto Reference:=ActiveCell, Scroll:=True
    'to set the target row and column to display
    'Application.Goto Reference:=Cells(ActiveCell.Row - 1, 1), Scroll:=True
    If ActiveCell.Row = 1 Then
        Application.Goto Reference:=Cells(ActiveCell.Row, 1), Scroll:=True
    Else
        Application.Goto Reference:=Cells(ActiveCell.Row - 1, 1), Scroll:=True
    End If
End Sub

This works fine in the .xlsm version, but when saved as a .xlsx workbook,
the code is stripped out.

Consequentially, when running the .xlsx version on the smarphone, the display does not 'snap' to the required row.

Is there a way around this, or must I accept the limitation ?

Many thanks.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
By design, xlsx workbooks do not include macros. There is nothing you can do about that. You can open and edit xlsm files on mobile just fine, but the macros will not run.
 
Upvote 0
Thanks for that.
Yes, I did realise the macro limitation with xlsx workbooks.
Probably stupid, but I wondered if there might be a way to overcome this problem with some sort of formula ?
Probably not.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top