VBA-Convert Julian Dates

PowerPoint

    Sponsored Links

    Next

  • 1. prevent new masters being pasted in?
    Hi, Working in PPT 2007 on Windows XP. When copying slides from one presentation to another, I would like to prevent users from possibly pasting in any master slides from the source file as well. (This happens if they chose "Keep source formatting" when they paste- instead of "Use destination theme"). Is there a way to prevent new masters from being pasted in? Lock down the masters somehow? Thanks for you help. TJ
  • 2. Inserting an object that works like a hyperlink
    Hello! I am trying to find out if there is anyway to insert an object (namely an embedded Word Doc) that, when in slide show view, will work like a hyperlink does. Just in case I'm not clear...I inserted a Word Doc into PPT and asked that it also show the Word Doc icon. When I go to slide show view and click on that icon, nothing happens. In order for me to open this doc, I have to exit slide show view, double click on the icon, and then it'll open. Is there anyway to open in while in slide show view...just like I would if I had inserted a hyperlink? Thanks in advance. hb
  • 3. PPT 2003 vs. 2007 issues
    Hello NG, I am really confused, I did a presentation with a lot of macros and graphics (using a lot of fancy png graphics and I am changing the visibility properties of those shapes programmatcially) which runs smooth in powerpoint 2003. However, if running the same ppt in ppt2007, the graphics seem not to update to show correct or not show at all. Did anybody made similar experiences already? Also I am programmatically drawing charts, in 2003 it updated after each new data set i was adding, in 2007 only at the end of the macro. Any hint or help is greatly appreciated. regards, Markus Sample png visibility Slide.Shapes("PicStatusGreen").Visible = msoFalse Slide.Shapes("PicStatusRed").Visible = msoFalse Slide.Shapes("PicStatusYellow").Visible = msoFalse Slide.Shapes("PicStatusGray").Visible = msoFalse Select Case status Case 1 Slide.Shapes("PicStatusGreen").Visible = msoTrue Case 2 Slide.Shapes("PicStatusRed").Visible = msoTrue Case 3 Slide.Shapes("PicStatusYellow").Visible = msoTrue Case 4 Slide.Shapes("PicStatusGray").Visible = msoTrue End Select Sample chart drawing ...loop Set oSh = Slide131.Shapes("MyChart") Set oGraphChart = oSh.OLEFormat.Object Set oDatasheet = oGraphChart.Application.DataSheet oDatasheet.Columns.Clear oDatasheet.Cells(1, i).Value = i oDatasheet.Cells(2, i).Value = j wait (0.2) DoEvents ..end loop
  • 4. Color in cells table
    I have to put different colors in different cells of a table. I want to create a macro to help me do this. I followed the instructions to create a macro, but nothing happenned. The macro does not contains any visual basic codes and does not work. The need is simple as: When in a cell, select the appropriate color and texture, and applied it to the selected cell. thks
  • 5. Having trouble with layout master slides
    First off: 1. I am very new to PowerPoint. 2. I checked Microsoft's Knowledge Base and didn't find what I needed, but that could be because I don't know the exact terminology to use to find it? That said, I am working on a PowerPoint template and have set up some layout master slides. For purposes of illustration I will focus on just one of them - "Staffing/Personnel". It has a title at the top ("Staffing/Personnel"), and two columns of copy that are made up of an indented heirarchy of bulleted text - First 24 point (no indent), then a line of 20 point (tabbed once), and then multiple lines of 14 point (tabbed again). When I add a new slide in normal view and specify the "Staffing/Personnel" layout, it gives me the correct title but only gives me the first line of text at 24 point. Is there a way to ensure that I can have it display both whole, formatted columns of copy when a new page is created? I would like end users to be able to just replace copy and not worry about tabbing or formatting. We're figuring that this will help us keep the end users from screwing up the layout too much. I hope that makes sense and thank you for any information you can give.

VBA-Convert Julian Dates

Postby UFNLZWxsaWdhbg » Sat, 30 Apr 2005 03:38:14 GMT

Hello all!
   Trying to create a text box on each slide in a presentation that give the 
Julian date.  I am running into a typt mismatch error that I can not seem to 
get around.  The code is as follows.

Sub txtBoxJDate()

    myDate = InputBox("Enter a Date", "DateBox (MTC Tech Inc.)", Date)
    
    Call d2Julian(myDate)
    
    ' Remember the view you're in now
    iOriginalView = ActiveWindow.ViewType

    ' Set PPT to Slide view
    ActiveWindow.ViewType = ppViewSlide

    
    For Each oSl In ActivePresentation.Slides
        iSlides = iSlides + 1
        
        ' Move proceedure from one slide to the next
        ActiveWindow.View.GotoSlide (oSl.SlideIndex)

        
        
ActiveWindow.Selection.SlideRange.Shapes.AddLabel(msoTextOrientationHorizontal, 334.75, 350.625, 14.5, 21.625).Select
            ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoFalse
            With ActiveWindow.Selection.TextRange.ParagraphFormat
                .LineRuleWithin = msoTrue
                .SpaceWithin = 1
                .LineRuleBefore = msoTrue
                .SpaceBefore = 0.5
                .LineRuleAfter = msoTrue
                .SpaceAfter = 0
            End With
            
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, 
Length:=0).Select
            With ActiveWindow.Selection.TextRange
                .Text = "Today's Julian Date is " & JulianDate & "."
                With .Font
                    .Name = "Arial"
                    .Size = 12
                    .Bold = msoTrue
                    .Italic = msoFalse
                    .Underline = msoFalse
                    .Shadow = msoFalse
                    .Emboss = msoFalse
                    .BaselineOffset = 0
                    .AutoRotateNumbers = msoFalse
                    .Color.SchemeColor = ppForeground
                End With
            End With
            With ActiveWindow.Selection.ShapeRange.TextFrame
                .HorizontalAnchor = msoAnchorCenter
                .VerticalAnchor = msoAnchorMiddle
                .WordWrap = msoTrue
                .AutoSize = ppAutoSizeNone
            End With
            With ActiveWindow.Selection.ShapeRange
                .Fill.Visible = msoTrue
                .Fill.Solid
                .Fill.ForeColor.SchemeColor = ppShadow
                .Fill.Transparency = 0#
                .Height = 21.62
                .Width = 188.62
                .Left = 525.38
                .Top = 512.38
            End With
    Next oSl
    
    ' Set the view back
    ActiveWindow.ViewType = iOriginalView

    
End Sub
Function d2Julian(myDate As Date) As String
   Dim DateYear As String       ' The year of the serial date.
   Dim JulianDay As String
   Dim JulianDate As String     ' The converted Julian date value
   
   ' Assign DateYear the year number
   DateYear = Format(myDate, "yy")
   
   ' Find the day number for myDate
   JulianDay = Format(Str(myDate - DateValue("1/1/" & Str(DateYear)) + 1), 
"000")
   
   ' Combine the year and day to get the value for JulianDate.
   JulianDate = DateYear & JulianDay
   
   ' Display the new date in the Julian date format.
   d2Julian = JulianDate
End Function

Does anyone see where I am falling down?

-- 
Thanks,

Patrick

Re: VBA-Convert Julian Dates

Postby David M. Marcovitz » Sat, 30 Apr 2005 04:37:00 GMT

see a couple of problems. First d2Julian requires something of type
date. myDate is a variant being used as a String. You might want to try:

Dim myDate As String
Dim myRealDate As Date

myDate = InputBox("Enter a Date", "DateBox (MTC Tech Inc.)", Date)
myRealDate = myDate

myRealDate = d2Julian(myRealDate)

This will convert the String to a Date, but I don't know if it is going
to be the date you really want. Next, you use the variable JulianDate in
txtBoxJDate, but this is not a global variable, so if you use the code
above it will assign your result to myRealDate, and you need to put
myRealDate in your text box. However, this doesn't seem to give you the
right result. At least it differs from any Julian date converters I could
find online. Perhaps you need the string version for the Julian date:

myDate = d2Julian(myRealDate)

and put myDate into your text boxes.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

"=?Utf-8?B?UFNLZWxsaWdhbg==?=" < XXXX@XXXXX.COM >
wrote in news: XXXX@XXXXX.COM :



Re: VBA-Convert Julian Dates

Postby UFNLZWxsaWdhbg » Sat, 30 Apr 2005 23:20:02 GMT

avid,
Thanks for the push in right direction! This is the layout that
actually works. Really appreciate the assist!

Sub txtBoxJDate()
Dim myDate As String
Dim myRealDate As Date
Dim jDate As String

myDate = InputBox("Enter a Date", "Julian Date Box", Date)
myRealDate = myDate
jDate = d2Julian(myRealDate)

' Remember the view you're in now
iOriginalView = ActiveWindow.ViewType

' Set PPT to Slide view
ActiveWindow.ViewType = ppViewSlide

For Each oSl In ActivePresentation.Slides
iSlides = iSlides + 1

' Move proceedure from one slide to the next
ActiveWindow.View.GotoSlide (oSl.SlideIndex)



ActiveWindow.Selection.SlideRange.Shapes.AddLabel(msoTextOrientationHorizontal, 334.75, 350.625, 14.5, 21.625).Select
ActiveWindow.Selection.ShapeRange.TextFrame.WordWrap = msoFalse
With ActiveWindow.Selection.TextRange.ParagraphFormat
.LineRuleWithin = msoTrue
.SpaceWithin = 1
.LineRuleBefore = msoTrue
.SpaceBefore = 0.5
.LineRuleAfter = msoTrue
.SpaceAfter = 0
End With

ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1,
Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "Today's Julian Date is " & jDate & "."
With .Font
.Name = "Arial"
.Size = 12
.Bold = msoTrue
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
With ActiveWindow.Selection.ShapeRange.TextFrame
.HorizontalAnchor = msoAnchorCenter
.VerticalAnchor = msoAnchorMiddle
.WordWrap = msoTrue
.AutoSize = ppAutoSizeNone
End With
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.SchemeColor = ppShadow
.Fill.Transparency = 0#
.Height = 21.62
.Width = 188.62
.Left = 525.38
.Top = 512.38
End With
Next oSl

' Set the view back
ActiveWindow.ViewType = iOriginalView
End Sub

' No change to the original function.


--
Thanks,

Patrick


"David M. Marcovitz" wrote:



Similar Threads:

1.PowerPoint 2008 changes "Date Modified" date for ppt files

I suspect this is a bug - but PowerPoint 2008 is changing the "Date Modified" field on my ppt files, even if I just open them without making any changes to the file.

Surely, the program shouldn't be making changes to a file when the user has not pressed "saved" or anything  and it creates problems when trying to work out when a file is last modified.

The behaviour is correct with pptx files (Last Opened date is changed, but Date Modified remains unchanged).

2.created date & modified date puzzle

Hi,

I have Office 2001 & I'm running OS 9.1.

I created a 24 slide powerpoint file -- graphics, text, charts, tables, ...
the works. Looks great.

Since I'm a recent victim of losing data from a crash, I probably saved that
file an average of twice per slide along the way -- maybe 50 times starting
when I had started the first slide and ending after I'd perfected all 24 and
sorted the slides the way I wanted them.

If I do Get Info for that file I'm told the file was created 5/23 9:26 PM
and I'm told the file was last modified 5/23 9:27 PM.

I'm good, but I'm not good enough to make that whole slide show in one
minute!

I opened up the file and went into File, Properties...

Under the "General" tab it tells me the file was created 5/23 9:26 PM and
modified 5/23 9:27 PM

Under the "Statistics" tab it tells me the file was created 5/19 2:29 PM and
modified 5/23 9:27 PM -- almost certainly true.

Why the difference?

3.Date Conflict: Excel/Powerpoint 1904/1900 Date Convention

Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Power PC

I've been suffering with the date conflict between the two conventions (MS starts counting at 1900 and Apple starts counting at 1904 so the serial dates stored in the machines are 1462 days apart: 4 years and 1 day) for some time now. <br><br>Most of the time one can get by with importing excel graphs by setting the Excel program on the Mac to use the 1904 date convention (preferences advanced).  However once the graph is in your Powerpoint, if you then send the presentation to someone else to print (Kinko's or a colleague for example) you could end up with bad dates again depending on THEIR settings. <br><br>This challenge is particularly pernicious at Kinko's (now FedEx Office) if you're trying to print a presentation while on the road, because Kinko's doesn't set all of their machines to the same convention (in fact they're unaware of this problem) and some places will ADD 1462 days to your dates and some places will SUBTRACT 1462 days to your dates.  My work-around to this problem is to append a second pair of graphs to the end of my presentation so that the slide book has THREE versions of each dated graph: one with Mac dates, one with 1462 ADDED and one with 1462 SUBTRACTED.  When the books print you pick the good graph, throw out the bad ones and bind.  It's nuts! <br><br>Now however, I have a colleague with a Mac and the exact same vintage Office for Mac (2008) program.  When he sends me (we're both on Macs mind you) a PPTX all the dates show up with 4 extra years in them!   <br><br>What gives?  Is there anyway to solve this problem?  Can graphs be imported to Powerpoint and then "fixed" in place (without making them fuzzy looking .jpegs of course)?  Is there a way to specify in Powerpoint the date convention to use?  Excel lets you pick 1900 or 1904, but I can't find something similar in Powerpoint.

4.How can I automatically delete dated slides that become past dated

I want to present a repeating daily schedule on a local cable system.  The 
plan is to date each slide in a two-week presentation to be updated weekly.  
Is it possible for PowerPoint to automatically delete slides that become 
past-dated?

5.VBA to convert PowerPoint presentation to Word

6. add vba module using VBA

7. Charts not up-to-date in PowerPoint

8. Excel to Powerpoint pastespecial date problem



Return to PowerPoint

 

Who is online

Users browsing this forum: No registered users and 68 guest