Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to save a file created at runtime automatically?

36 views
Skip to first unread message

Jürgen Meyer

unread,
May 13, 2013, 11:48:37 AM5/13/13
to
Here is an example:
The following URL creates a file name url.json

https://www.googleapis.com/urlshortener/v1/url?shortUrl=http://goo.gl/maps/Lq84E

The file contains the Long URL of the Short URL transmitted.

I tried:
Applicaction.Followhyperlink URL

A window pops up immediately asking me where to save the file etc.
But I want to save the file automatically in a predefined folde without
interaction.

Is there a way to do that or is there a better way to get the Long URL from
the Short URL programmatically?

Juergen

P.S.
I have Office 12

noodnutt

unread,
May 21, 2013, 8:25:00 AM5/21/13
to
Hi Jurgen

If memory serves me correctly, the .json file is an API that you download once and save onto your system so that you can use it when interacting with Google Maps Website.

If you have a Google Account, there are features there that allow you to switch on certain services. I had a look at using it a while ago and it ended up in the too hard basket.

HTH
Mick.


Patrick Finucane

unread,
May 21, 2013, 12:20:37 PM5/21/13
to
On Monday, May 13, 2013 10:48:37 AM UTC-5, Jürgen Meyer wrote:
> Here is an example: The following URL creates a file name url.json https://www.googleapis.com/urlshortener/v1/url?shortUrl=http://goo.gl/maps/Lq84E The file contains the Long URL of the Short URL transmitted. I tried: Applicaction.Followhyperlink URL A window pops up immediately asking me where to save the file etc. But I want to save the file automatically in a predefined folde without interaction. Is there a way to do that or is there a better way to get the Long URL from the Short URL programmatically? Juergen P.S. I have Office 12

I don't get what you are doing. You have a file you want to save yet you execute a FollowHyperlink? What does following a hyperlink have to do with saving a file?

Look at FileCopy to copy the file to a particular folder.

The Frog

unread,
May 21, 2013, 4:36:00 PM5/21/13
to
JSON = Java Script Object Notation
It's not actually a file you are receiving. It is a text based
description of a Javascript object. You would therefore need to
receive it as text, interpret / parse the text into an object and
then interact with that object to retrieve the value you are after.

AFAIK there are no native abilities in VBA to do this. You would
therefore need to find a way to correctly parse the JSON object in
VBA. Maybe there is a VB6 solution to this you can adapt. Depending
on what that solution needs will determine how you go about
retrieving the JSON information.

--
Cheers

The Frog

Jürgen Meyer

unread,
May 21, 2013, 5:18:17 PM5/21/13
to
Hi Mick,
Thanks for the answers.
The intention was to get the long url from
the short url and to store some content of the url.jason in an Access table
automatically.
The url.json is (a nearly) normal text file containing the coordinates and
some other information.

I then want to write the coordinates into a picture
(GPSLatitude/GPSLongitude), selected in my database.
(EXIF/IPTC-Tags)

In the meantime I found an easier way to get that information.

ReadyState_Complete = 4
Set objApp = CreateObject("InternetExplorer.Application")
With objApp
.Navigate URL:=" http://goo.gl/maps/GcybT"
.Visible = True
Do
DoEvents
Loop While .Busy Or .ReadyState <> ReadyState_Complete
strLongUrl = .LocationURL
.Quit
End With

So in this special case, the problem is solved now.

Juergen

Jürgen Meyer

unread,
May 21, 2013, 5:23:25 PM5/21/13
to
On Tue, 21 May 2013 09:20:37 -0700 (PDT), Patrick Finucane
<patrickf...@gmail.com> wrote:
Hi Patrick,

Follow the hyperlink and you will be enlightened

Juergen
0 new messages