Hello all
I am having problems with a colleague sometimes being unable to run a macro which saves PDFs to the desktop. I haven't found a solution online, so I'm hoping someone here might know what is going on.
The macro picks up the file path (sUserPth) from a cell in the active worksheet, runs through a few lines of code to prepare the sheet to be exported to PDF, and then creates the PDF as follows:
ChDir sUserPth
pd.Range(Cells(1, 3), Cells(iBlankEnd + 5, 23)).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
lg.Cells(i, 17).Value, OpenAfterPublish:=False
This works for almost everybody (assuming we have the correct file path saved in the cell). However I have one colleague for whom it regularly doesn't work. He is on different systems, as he works for an outsourcing company, so I have been wondering if something here is causing the issue. Whereas the rest of us work on Excel installed directly on our laptops, he has to log into Excel via Citrix.
For example, this morning he got an error stopping at this line of code saying the file path wasn't found. After restarting his computer the macro worked without any problems.
Unfortunately we cannot take the easiest route and bring this file back in house, as it is a report that has been contracted out and will cause all sorts of issues with service contracts.
Thank you!
I am having problems with a colleague sometimes being unable to run a macro which saves PDFs to the desktop. I haven't found a solution online, so I'm hoping someone here might know what is going on.
The macro picks up the file path (sUserPth) from a cell in the active worksheet, runs through a few lines of code to prepare the sheet to be exported to PDF, and then creates the PDF as follows:
ChDir sUserPth
pd.Range(Cells(1, 3), Cells(iBlankEnd + 5, 23)).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
lg.Cells(i, 17).Value, OpenAfterPublish:=False
This works for almost everybody (assuming we have the correct file path saved in the cell). However I have one colleague for whom it regularly doesn't work. He is on different systems, as he works for an outsourcing company, so I have been wondering if something here is causing the issue. Whereas the rest of us work on Excel installed directly on our laptops, he has to log into Excel via Citrix.
For example, this morning he got an error stopping at this line of code saying the file path wasn't found. After restarting his computer the macro worked without any problems.
Unfortunately we cannot take the easiest route and bring this file back in house, as it is a report that has been contracted out and will cause all sorts of issues with service contracts.
Thank you!