runtime error 1004 :PDF Export to Onedrive sub-folder

suthees

New Member
Joined
Dec 18, 2018
Messages
1
Hi Experts,
I have a problem so far, I tried to export my code to PDF format,
the situation is runtime error 1004

what i did so far is that .

with this path work just fine
Filename:="https://d.docs.live.net/FBC3F27912XYZ123/Homeandcare work/Invoice Record History/" & "61_" & bil_id & "_" & bildate & "_" & comname & ".pdf", _
the code exported to pdf to "Invoice Record History" folder properly

however, after i add another subfolder

Filename:="https://d.docs.live.net/FBC3F27912XYZ123/Homeandcare work/Invoice Record History/BillingReport/" & "61_" & bil_id & "_" & bildate & "_" & comname & ".pdf", _

turn out this comes with runtime error and export is unsuccessful

if any of you guys have familiar with this problem before please help
--------------------------------------------------------------------------------------------------------------
Sub Billing_saveas()


Dim bil_id As String
bil_id = Format(Range("L6"), "00000")
'Range("T2").Value = bil_id


Dim bildate As String
bildate = Format(Range("L7"), "yyyy_mm_dd")


Dim comname As String
comname = Range("L5")


ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="https://d.docs.live.net/FBC3F27912XYZ123/Homeandcare work/Invoice Record History/BillingReport/" & "61_" & bil_id & "_" & bildate & "_" & comname & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=False, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False





End Sub
----------------------------------------------------------------------------------------------------------------------------------
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Check to make sure the syntax of the BillingReport is correct...no spaces, underscores,capitals, etc
Make sure the folder is accessible
 
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top