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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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