Update from XL2016 to 365 gives Compile errors in VBA code

EdNerd

Active Member
Joined
May 19, 2011
Messages
464
Over the weekend our company pushed an update and moved us from Office 2016 32-bit to MS Office 365 64-bit. As "Keeper of the Flame" with Excel macros, I got the calls that users are seeing errors when the open certain workbooks. Most were resolved by adding PtrSafe to Library calls. But there's a few that have me scratching my head. Any help is greatly appreciated.

-- I needed to check if a file could touch the server. I was using "If ThisWorkbook.bServerOnline =True Then" -- but this morning that's an error. I can't find any documentation for bServerOnline - almost makes me wonder if it's supposed to be a UDF, which I can't find either. I'm holing someone can provide info on this, or a method to see if the workbook can connect to the server.

-- I have a UDF called SpecialFolderPath2 which I use in several places. The Compiler is throwing the error "Ambiguous name detected: SpecialFolderPath2" on code inside a form, and the function exists inside a module in the same project. All it does is return the path to the user's Templates folder. When I put the code in a Sub, it runs okay. (I added a Dim SpecialFolderPath2 as String.) Any suggestions??
VBA Code:
Public Function SpecialFolderPath2() As String
Dim objWSHShell As Object
Set objWSHShell = CreateObject("WScript.Shell")
SpecialFolderPath2 = objWSHShell.SpecialFolders("Templates")
End Function

-- Is there any way to make the Compiler ignore a certain error so I can skip to the next one?

Thanks!
Ed
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
FWIW, my MS Office 365 64-bit install runs your SpecialFolderPath2 function without issue.

If ThisWorkbook.bServerOnline =True Then implies that .bServerOnline is a property of the workbook object; but I don't see it and my compiler does not like it.
 
Upvote 0
I'd imagine that bServerOnline is either a function or a variable declared in the ThisWorkbook module.
 
Upvote 0
I'd imagine that bServerOnline is either a function or a variable declared in the ThisWorkbook module.
No go - the name doesn't exist anywhere else in the code. Oh well - if it causes a problem, I'll find a work-around.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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