Excel automation Script

%3CLINGO-SUB%20id%3D%22lingo-sub-1970704%22%20slang%3D%22en-US%22%3EExcel%20automation%20Script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970704%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20the%26nbsp%3BRon%20de%20Bruin%20script%20to%20run%20an%20automation%20to%20send%20various%20excel%20files%20to%20different%20users%20-%20I%20have%20customized%20it%20for%20my%20needs%20and%20it%20works%20very%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20thing%2C%20is%20it%20possible%20to%20a%20SharePoint%20file%20and%20send%20that%20instead%20of%20a%20file%20saved%20locally%20on%20the%20machine%3F%20I%20tried%20to%20run%20the%20script%20but%20there%20is%20an%20error%20in%20the%20code%20line%20below%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20Each%20FileCell%20In%20rng.SpecialCells(xlCellTypeConstants)%3CBR%20%2F%3EIf%20Trim(FileCell)%20%26lt%3B%26gt%3B%20%22%22%20Then%3CBR%20%2F%3E%3CSTRONG%3EIf%20Dir(FileCell.Value)%20%26lt%3B%26gt%3B%20%22%22%20Then%3C%2FSTRONG%3E%3CBR%20%2F%3E.Attachments.Add%20FileCell.Value%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20change%20the%20code%20so%20it%20picks%20up%20the%20file%20saved%20on%20the%20SharePoint%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1970704%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

Hi,

 

I am using the Ron de Bruin script to run an automation to send various excel files to different users - I have customized it for my needs and it works very well.

 

The only thing, is it possible to a SharePoint file and send that instead of a file saved locally on the machine? I tried to run the script but there is an error in the code line below:

 

For Each FileCell In rng.SpecialCells(xlCellTypeConstants)
If Trim(FileCell) <> "" Then
If Dir(FileCell.Value) <> "" Then
.Attachments.Add FileCell.Value

 

Is there a way to change the code so it picks up the file saved on the SharePoint?

 

Thanks. 

0 Replies