• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Macro written in 32 bit System - Not working as it should in 64 bit System - the attached link to SharePoint in excel now is read only|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Macro written in 32 bit System - Not working as it should in 64 bit System - the attached link to SharePoint in excel now is read only|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosMacro written in 32 bit System - No…
sp_PrintTopic sp_TopicIcon
Macro written in 32 bit System - Not working as it should in 64 bit System - the attached link to SharePoint in excel now is read only
Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
1
July 21, 2021 - 1:11 am
sp_Permalink sp_Print sp_EditHistory

So I have written a spreadsheet that basically moves to each person after they have completed their section, it attaches a link to the SharePoint site and sends an email to the next person in the chain with that link that opens the actual file on SharePoint.

The file was written in 32 Bit and worked fine, but now I have been upgraded to 64 Bit the link opens up as read only and the spaces in the filename have been replaced by %20 

 

Can anyone help with this please??

 

Here is the Code

 

Sub YES_BUTTON_PROJECT_LEADER()
'
' YES_BUTTON_PROJECT_LEADER Macro
'

'

ActiveSheet.Shapes("YES").Select
ActiveSheet.Shapes("YES").Fill.ForeColor.RGB = RGB(0, 255, 0) ' fill: dark green color
ActiveSheet.Shapes("YES").Line.BackColor.RGB = RGB(198, 217, 241) ' border: light blue color
ActiveSheet.Shapes("YES").TextFrame.Characters.Font.Color = RGB(0, 0, 0) ' text: white color
Range("A1").Formula = 14.28571 'fills cell with button value
' nonactive
ActiveSheet.Shapes("no").Select
ActiveSheet.Shapes("no").Fill.ForeColor.RGB = RGB(255, 0, 0) ' fill: light blue color
ActiveSheet.Shapes("no").Line.BackColor.RGB = RGB(198, 217, 241) ' border: light blue color
ActiveSheet.Shapes("no").TextFrame.Characters.Font.Color = RGB(0, 0, 0) ' text: dark blue color

'ActiveWindow.SelectedSheets.Visible = True
Range("A31").Select
Application.Goto Reference:="R1C1"

ActiveWorkbook.SaveAs Filename:= _
"https://gbconnect.sharepoint.com/sites/BUKGBGATEPROCESS/MDF/MAIDSTONE COMPLETED MDF FORMS 2021/" & ActiveWorkbook.Name
ActiveWorkbook.AutoSaveOn = True

Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
Set OutApp = CreateObject("Outlook.Application")

mbody = "Hello" & vbNewLine & _
"We have a new MDF Brief In, The Project Leaders Section is complete" & vbNewLine & _
"NPD is first in the flow so please complete your section" & vbNewLine & _
" " & vbNewLine & _
""

sbody = "Many Thanks" & vbNewLine & _
"Kind Regards" & vbNewLine & _
" " & vbNewLine & _
" " & vbNewLine & _
""
With OutlookMail

.To = "email.address.com" 
.CC = ""
.BCC = ""
.Subject = "Please be aware that a new MDF for " & Sheets("Main Menu").Range("I10").Value & " " & Sheets("Main Menu").Range("I11 ").Value & " " & Sheets("Main Menu").Range("I12 ").Value & " " & Sheets("Main Menu").Range("I13 ").Value & " " & Sheets("Main Menu").Range("I14 ").Value & " " & Sheets("Main Menu").Range("I15 ").Value & " " & Sheets("Main Menu").Range("I16 ").Value & " " & Sheets("Main Menu").Range("I17 ").Value
.Body = mbody & sbody & Sheets("Project Leader").Range("d14").Value
.Attachments.Add ActiveWorkbook.FullName
.Send

End With

Set OutlookMail = Nothing
Set OutlookApp = Nothing

 

End Sub

 

many Thanks 

 

Richard

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
July 22, 2021 - 3:20 pm
sp_Permalink sp_Print

Try encoding the url:

url=Application.WorksheetFunction.EncodeUrl("https://gbconnect.sharepoint.com/sites/BUKGBGATEPROCESS/MDF/MAIDSTONE COMPLETED MDF FORMS 2021/" & ActiveWorkbook.Name)

ActiveWorkbook.SaveAs Filename:=url

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
3
July 22, 2021 - 4:13 pm
sp_Permalink sp_Print

Hi Catalin,

 

That gave the following runtime error 1004

Microsoft Excel cannot access the file

C:\WINDOWS\system32\78741A00

 

When I debug it stops at the following line

ActiveWorkbook.SaveAs Filename:=Url

 

Url is as you stated  Url = Application.WorksheetFunction.EncodeURL("https://gbconnect.sharepoint.com/sites/BUKGBGATEPROCESS/MDF/MAIDSTONE COMPLETED MDF FORMS 2021/" & ActiveWorkbook.Name)

 

I have no idea why its trying to look up C: drive

 

Even more confused

 

Kind Regards

 

Richard

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
July 22, 2021 - 6:25 pm
sp_Permalink sp_Print sp_EditHistory

Try recording a macro while saving the file manually to the address you mentioned:

https://gbconnect.sharepoint.c...../MAIDSTONE COMPLETED MDF FORMS 2021

Once you put that path in file explorer address, if you're not logged in you should see a popup asking to log in.

I assume you have the proper credentials to save there.

Another way is to go to that site in browser and sync that documents folder. (there should be a Sync button in that site documents page)

This will sync to a local folder and you can save locally, the sync agent will send the file to cloud.

You can also map a sharepoint folder:

https://support.microsoft.com/.....d80ccf0f53

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
5
July 27, 2021 - 5:09 pm
sp_Permalink sp_Print

Good Morning Catalin,

 

1. Will not work as I need the filename to change each time, the folder address is correct

2. I do have the proper credentials

3. The folder is already synced

4. When I try to Map the Sharepoint folder I get the error "The Folder you entered does not appear to be valid. Please choose another

 

This is proving to be a real challange

 

Kind Regards

 

Richard

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
July 27, 2021 - 6:48 pm
sp_Permalink sp_Print

If you're saying that the folder is already synced to your computer, why don't you save on the local synced folder?

Avatar
richard hayward
Member
Members
Level 0
Forum Posts: 11
Member Since:
February 8, 2019
sp_UserOfflineSmall Offline
7
July 28, 2021 - 4:10 pm
sp_Permalink sp_Print

Hi

 

Thanks for your continued support on this issue.

 

I dont actually want to attach the file to the email just a link to the file, I think my code is adding an attachment and changing the name due to spaces in the filename.

 

I need the person to click a button in the program which saves the file in the location and attaches a link that gets sent onto the next person by email, when they click the link it opens the actual file on SharePoint.

 

What I currently have is an attachment with the wrong name and read only

 

I really hope that makes sense

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 205
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
stuart burge
Bruce Tang Nian
Scot C
Othman AL MUTAIRI
Misael Gutierrez Sr.
Attif Ihsan
Kieran Fee
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Forum Stats:
Groups: 3
Forums: 24
Topics: 6223
Posts: 27295

 

Member Stats:
Guest Posters: 49
Members: 31920
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.