kylefoley76
Well-known Member
- Joined
- Mar 1, 2010
- Messages
- 1,553
When I use the following code everything works:
But I'm going to be moving files around and accessing this subroutine from other folders so I need to use the full path but I cannot get it to work. I already looked up the full path using the locals window. So when I put in:
That failed. I also tried:
But that failed too. I'm getting a subscript out of range error whenever I use the long string. The following image will demonstrate that I'm using the correct string. I know mrexcel does not like linking to 3rd party sites but I have no way to posting a screenshot other than the following.
https://ibb.co/mHzaoz
Code:
Dim wb As String
wb = "xlwings_temp2.xlsx"
Workbooks(wb).Activate
Application.ScreenUpdating = True
Workbooks(wb).Save
But I'm going to be moving files around and accessing this subroutine from other folders so I need to use the full path but I cannot get it to work. I already looked up the full path using the locals window. So when I put in:
Code:
Dim wb As String
wb = "/Users/kylefoley/PycharmProjects/inference_engine2/inference2/proofs/other/xlwings_temp2.xlsx"
Workbooks(wb).Activate
Application.ScreenUpdating = True
Workbooks(wb).Save
That failed. I also tried:
Code:
Dim pt As String, cd As Workbook
pt = "/Users/kylefoley/PycharmProjects/inference_engine2/inference2/proofs/other/xlwings_temp2.xlsx"
Workbooks.Open FileName:=pt
Set wb = Application.Workbooks(pt)
Application.ScreenUpdating = True
wb.Save
https://ibb.co/mHzaoz