jrlclist
04-08-2009, 08:55 AM
Ultimately, I am creating a report in Access that points to a directory that has bmp files. The problem I am having is being able to get the charts to download in bmp format rather than png. Access won't import png files.
This works with all the other declarations, etc in my vba code modules:
Sub DownloadPicSub()
Dim sSourceUrl As String, sLocalFile As String
Dim DownloadPic As Boolean
sSourceUrl = "My URL to chart" 'the only item in this webpage is the chart, in fact the View Source is ghosted (not sure what this means exactly).
sLocalFile = "C:\msft.png" 'used msft as an example
DownloadPic = URLDownloadToFile(0&, sSourceUrl, sLocalFile, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
End Sub
1. If I change the .png to .bmp, no luck, still a png.
2. I've searched for how to invoke the "Save Picture As..." right click and set to file type bmp, but no luck.
3. I've searched to find out how to launch MS Paint or the Picture and Fax Viewer to open the png files and convert them. No luck there either.
I want to do this programatically, as there are potentially dozens of charts that will be created in the web page, downloaded and used in the Access report.
Since this is my first post, the "Preview Post" wont allow me insert the link for sSourceUrl. Hope that doesn't matter too much.
Any help is greatly appreciated.
Jon
This works with all the other declarations, etc in my vba code modules:
Sub DownloadPicSub()
Dim sSourceUrl As String, sLocalFile As String
Dim DownloadPic As Boolean
sSourceUrl = "My URL to chart" 'the only item in this webpage is the chart, in fact the View Source is ghosted (not sure what this means exactly).
sLocalFile = "C:\msft.png" 'used msft as an example
DownloadPic = URLDownloadToFile(0&, sSourceUrl, sLocalFile, BINDF_GETNEWESTVERSION, 0&) = ERROR_SUCCESS
End Sub
1. If I change the .png to .bmp, no luck, still a png.
2. I've searched for how to invoke the "Save Picture As..." right click and set to file type bmp, but no luck.
3. I've searched to find out how to launch MS Paint or the Picture and Fax Viewer to open the png files and convert them. No luck there either.
I want to do this programatically, as there are potentially dozens of charts that will be created in the web page, downloaded and used in the Access report.
Since this is my first post, the "Preview Post" wont allow me insert the link for sSourceUrl. Hope that doesn't matter too much.
Any help is greatly appreciated.
Jon