PowerPoint 2013 store array data VBA

I have a PowerPoint app where I import some tabular data in a CSV file into an array. Of course I need to import the CSV each time I run it.

Is it possible for PowerPoint to store the data in a non-volatile way? For instance, is there a 'spreadsheet' within the PowerPoint 2013 that I can dump the data, so that it will persist?

If so can someone point me some sample VBA code?

Thanks.
hindersalivaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JSRWilsonCommented:
You could store it in a series of presentation Tags maybe. If you post your csv file I can post more code but the basis is ....

ActivePresentation.Tags.Add "Name","Value"
0
hindersalivaAuthor Commented:
Hi JRSW, I have attached an example of a CSV file I need to import.

BTW I may be wrong but I seem to remember there was a 'spreadsheet object' in PowerPoint at one time that we could access programmatically?
4MeasuresPerSlide.csv
0
JSRWilsonCommented:
The data csv needs to be on the desktop in this code (easy to change the path of course)

Read csv into Tags

Sub getData()
Dim iFileNum As Integer
Dim strPath As String
Dim strinput As String
Dim raySplit() As Long
Dim lineNum As Long
strPath = Environ("USERPROFILE") & "\Desktop\4MeasuresPerSlide.csv"
iFileNum = FreeFile
Open strPath For Input As #iFileNum
While Not EOF(iFileNum)
Line Input #iFileNum, strinput
lineNum = lineNum + 1
'strip extra "
strinput = Replace(strinput, Chr(34), "")
ActivePresentation.Tags.Add Name:="TAG" & CStr(lineNum), Value:=strinput
Wend
End Sub

Get values back for tag number (use call getTag(x))

Sub getTag(lngNum As Long)
Dim raySplit() As String
Dim tagName As String
Dim val1 As Long
Dim val2 As Long
Dim val3 As Long
Dim val4 As Long
Dim tagValue As String
tagName = "TAG" & CStr(lngNum)
tagValue = ActivePresentation.Tags(tagName)
raySplit = Split(tagValue, ",")
val1 = CLng(raySplit(0))
val2 = CLng(raySplit(1))
val3 = CLng(raySplit(2))
val4 = CLng(raySplit(3))
MsgBox "Value 1 = " & val1 & vbCrLf _
 & "Value 2 = " & val2 & vbCrLf _
& "Value 3 = " & val3 & vbCrLf _
& "Value 4 = " & val4
End Sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

hindersalivaAuthor Commented:
Thanks JSRW, I'll play around with that.
0
Stephen RindsbergCommented:
A chart in PowerPoint has a spreadsheet that you can access programmatically, but working with tags is a great deal simpler and more reliable across various PPT versions.
0
hindersalivaAuthor Commented:
Thanks Stephen. Ah, so that's what I seem to remember (but had forgotten). I'm working on the tags idea. That was new to me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft PowerPoint

From novice to tech pro — start learning today.