08-08-2019 01:30 PM
CUCM 10.5.2
New laptop is Windows10 64bit - Old laptop Windows7 32bit
BAT excel files on my Win7 moved to Win10 machine.
When I try and fill in a field (adding some phones), I get a pop up with "microsoft visual basic for application" code for the BAT sheet. I click ok, but each cell in Excel I enter info into gets this pop up, happens over and over.
(not my area of expertise, I didn't realize that VBA code was there - vendor installed original version of CUCM many years ago and a few versions ago - this never popped up previously)
Error pop up = "The code in the project must be updated for use on 64-bit systems. Please review and update Declare statements and them mark them with the PtrSafe attribute."
I have no experience with Visual Basic for Applications or implications to this BAT excel sheet if I make some uneducated guesses. The code has the first (3) Private Declare statements in RED - which is where I assume something needs to change.
Search of internet , old posts suggest putting "PtrSafe" in the Declare statement ,but no posts reference CUCM. Looked at all the "BAT" references here in the community, nothing here either.
The below are the (3) in RED Declare statements:
Private Declare Function SHBrowseForFolder _
Lib "shell32" _
( _
lpbi As BrowseInfo _
) _
As Long
Private Declare Function SHGetPathFromIDList _
Lib "shell32" _
( _
ByVal pidList As Long, _
ByVal lpBuffer As String _
) _
As Long
Private Declare Function lstrcat _
Lib "kernel32" _
Alias "lstrcatA" _
( _
ByVal lpString1 As String, _
ByVal lpString2 As String _
) _
As Long
Any advice ? Will the insertion of PtrSafe in Declare statement fix issue? (in between 'Declare' and 'Function' ?)
08-08-2019 10:09 PM
08-09-2019 03:12 PM
Hi Anthony,
Thanks for the response, the BAT file was a little overkill but I was used to quick entry into the Excel spreadsheet. Seems faster than creating the csv / or txt file .... but that may be just because I am used to using Excel for a lot of things.
I will use your suggestion ... maybe someone will come along and share other ways for us to try.
02-26-2020 07:48 AM
here the solution.
On VBA Code add PtrSafe after the Declare statements, *** TIP: Save file as .XLT
32Bit Config - VBA | 64Bit Config - VBA |
Private Declare Function SHBrowseForFolder _ Private Declare Function SHGetPathFromIDList _ Private Declare Function lstrcat _ | Private Declare PtrSafe Function SHBrowseForFolder _ Private Declare PtrSafe Function SHGetPathFromIDList _ Private Declare PtrSafe Function lstrcat _ |
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide