rsutton1981
New Member
- Joined
- Mar 9, 2016
- Messages
- 47
- Office Version
- 365
- Platform
- Windows
Hi,
I am managed to get PDF export of sheets from excel to go to sharepoint. But when i run the code below it seems to loop back and start the process again, whilst not creating new files in the sharepoint folder it is updating the revision in the metadata. it creates all the files but never gets to the MsgBox stage.
Any help would be appreciated.
I am managed to get PDF export of sheets from excel to go to sharepoint. But when i run the code below it seems to loop back and start the process again, whilst not creating new files in the sharepoint folder it is updating the revision in the metadata. it creates all the files but never gets to the MsgBox stage.
Any help would be appreciated.
VBA Code:
Sub Button6_Click()
Application.ScreenUpdating = False
Dim ws As Worksheet
Dim ShCount As Integer, i As Integer, j As Integer
ShCount = Sheets.Count
For i = 4 To ShCount
For j = i + 1 To ShCount
Sheets(j).Select
nm = Sheets(j).Name
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:= _
"https://hartiganengineers.sharepoint.com/sites/QMSupload/shared%20documents/" & nm & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Next j
Next i
Application.ScreenUpdating = True
MsgBox "Export Complete"
End Sub