Excel 64 bit error

wikus

Active Member
Joined
May 2, 2010
Messages
305
Office Version
  1. 365
The attached code insert lines specified by user. It gives an compiler error when used on Excel 64 bit. how can I change it to work on 64 bit.
Code:
Sub InsertLine()
Dim Rng, n As Long, k As Long
Dim r As Long
ActiveSheet.Unprotect "hubert"
Application.ScreenUpdating = True
r = ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row - 1
Rng = InputBox("Enter number of rows required.")
If Rng = "" Then Exit Sub
On Error Resume Next
    ActiveSheet.Range(r & ":" & r).Select
    Selection.Resize(rowsize:=Rng).EntireRow.Resize(rowsize:=Rng).Insert Shift:=xlUp
    Selection.Offset(Rng).AutoFill Selection.Resize(rowsize:=Rng + 1), xlFill
    ActiveSheet.Range("A" & r).Select
ActiveSheet.Protect "hubert"
End Sub
Any help will be appreciated
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
What's the error message? I can't see anything there that should require conversion for 32 vs 64 bit.
 
Upvote 0
The VBA error is:
Compile error in hidden module: Module1
This error commonly occurs when code is not compatible with the version, platform, or architecture of this application.

It runs without problems on Excel 2010 and 2013 32 bit versions
 
Upvote 0
If you unprotect the code, why is flagged as being the problem?
 
Upvote 0

Forum statistics

Threads
1,206,921
Messages
6,075,581
Members
446,147
Latest member
homedecortips

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