Hi!
The project progresses and I'm now able to produce worksheets from various data sources then name them from cell values and save them to a folder created in OneDrive (also created from cell values).
I now need to be able to open a specific worksheet in a specific folder from any computer in the country using cell values.
I'm able to achieve this by opening the worksheet from the OneDrive folder on my personal computer using
Dim Path1 As String
Dim Rightfilename As String
Path1 = "C:\Users\Frank\OneDrive\" & ThisWorkbook.Sheets("Running Order").Range("F1").Value 'F1 = Meeting Number (ABC334) which is the name of the folder
Rightfilename = Range("BN1") & (".xlsx") 'BN1 = Right side Meeting Number and Team Name (ABC334 - Best Runners) which is the name of the worksheet
Workbooks.Open Path1 & "\" & Rightfilename
However, to be able to open the worksheet from any computer I think I'll need to go directly to OneDrive. I've replaced the Path1 opening text with the OneDrive address and the secret bit that gets into my particular OneDrive files;
Dim Path1 As String
Dim Rightfilename As String
Path1 = "https://onedrive.live.com/?id=root&cid={My secret bit!}" & ThisWorkbook.Sheets("Running Order").Range("F1").Value 'F1 = Meeting Number (ABC334) which is the name of the folder
Rightfilename = Range("BN1") & (".xlsx") 'BN1 = Right side Meeting Number and Team Name (ABC334 - Best Runners) which is the name of the worksheet
Workbooks.Open Path1 & "\" & Rightfilename
but using the cell values to find the correct folder and worksheet doesn't seem to work as the code ends up opening a blank, "Read Only" worksheet.
As I will need to be able to open one of many folders (and worksheets within them) from variable cell values I can't put the URL for the required folder into the Code. Putting a \ or / between the https address and cell references doesn't appear to do anything.
Any ideas please? ("We're" so close to achieving the overall project!!
)
Frankie
Bookmarks