Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

Project to excel - vba - 1004 Application-defined or object-defined error

$
0
0

Hi all,

I am trying to move my task data from Project to Excel and after a lot of editing I am finally close to my goal. However, I am stuck on the last couple of road blocks. For some reason I get the "1004 - Application-defined or object-defined error" when I run the code below. What's weird is that is the ".LeftFooter..." line runs properly whereas the orientation line gives me the error. Both leftfooter and orientation are properties of the same page setup object so its funny that I can access some of the properties and not others?

With xlApp.ActiveSheet.PageSetup .LeftFooter = Format(Now(), "mm/dd/yy") .Orientation = xlLandscape End With

My second issue is the same error when I run the code below:

With xlApp.ActiveSheet
        For i = 1 To .VPageBreaks.count
            .VPageBreaks(i).DragOff Direction:=xlToRight, RegionIndex:=1
        Next i
End With

I would greatly appreciate any help!

Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>