Function SheetExists on 64 bits

zackete

New Member
Joined
Apr 15, 2012
Messages
42
Office Version
  1. 365
Hey there,

Does anyone knows how can I make this function compatible with 64 bits systems?

Code:
 Function SheetExists(strSheetName As String) As Boolean
     ' returns TRUE if the sheet exists in the active workbook
   SheetExists = False
   On Error Resume Next
   SheetExists = Len(Sheets(strSheetName).Name) > 0
   On Error GoTo 0
End Function

I was playing around with the PtrSafe but can't find the proper way to make it works :S

Thanks in advance!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
That function is already 64 bit compatible. (PtrSafe is only for API calls)
 
Upvote 0
Thank you RoryA,

The code is working fine on my computer but I shared it with other fellows and they keep receiving the following error:

Compile error:

The code in this project must be updated for use on 64-bit systems.
Please review and update Declare statements and then mark them with the PtrSafe attribute.


Any advice?
 
Upvote 0
You must have API calls in your code somewhere, but that is not one of them. ;)
 
Upvote 0
Use the Find function in the VB Editor and search for the word 'Declare'
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,668
Members
448,977
Latest member
moonlight6

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