There has been a question similar to this on How to Convert Excel Cell Values Into Individual PNG Files, however (#1) I haven't been able to overcome the "Run-Time 70: Permission Denied Error" and (#2) I want to name each individual PNG file as a corresponding number on the Excel sheet. For example, I have an Excel document that contains in Column A a list of numbers and in Column B a list of cities. I want to get a PNG file of the word that has the city name in Column B, and I want that PNG file to be named the corresponding number in Column A.
For Example:
Column A | Column B |
---|---|
1 | Tokyo |
2 | New York |
1.png = Image of the cell word Tokyo
2.png = Image of the cell word New York
I've tried hours and hours on this and I can't seem to get over the "Run-Time 70: Permission Denied Error". Also, I found this example of a code that I thought I was so close to getting to work, but it only worked for .txt format and not .png format. Here is the code for that:
Sub Create_Txt_File()
Dim a As Variant, i As Long
a = Range("C1:G" & Range("G" & Rows.Count).End(3).Row).Value2
For i = 1 To UBound(a, 1)
Open "/Users/mycomputer/Desktop" & "/" & a(i, 1) & ".txt" For Output As #1
Print #1, a(i, 5)
Close #1
Next i
End Sub
Like I said, this was ALMOST perfect for what I needed done, however, I tried to change the variables to .png but was never able to get the files to open properly. I assume it must be more complicated than simply changing ".txt" to ".png" in the code. If anyone could help me out with this, it would be amazing! I'm trying to turn around 20,000 Excel Cells into individual PNG files, and I definitely do not want to have to manually enter all of the information if I can help it.