INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Google Doc Spreadsheet

Google Doc Spreadsheet

(OP)
Has anyone tried to use VB6 to save a Google Doc Spreadsheet as a CSV or XLS document?

If so, can you point me to any examples or documentation?

Thanks.

Swi

RE: Google Doc Spreadsheet

(OP)
Thanks. Guess I'll have to delve into .NET.

Swi

RE: Google Doc Spreadsheet

Could be your only choice.

Whether by error or on purpose the GData 3.0 specs are not visible to the public, forcing you to use only the provided API libraries now. Without specs you can't even write a VB6 API library if you wanted to go to the trouble.

RE: Google Doc Spreadsheet

(OP)
Did a bit more research. Seems a bit overkill to me for using .NET and the Google Sheets API.

Why not simply Publish the Google Doc as a CSV to the web and then just write a simple routine in VB6 to download.

There is even a checkbox that says Automatically republish when changes are made.

I have this working and took 10 minutes. Is there a reason someone would not do it this way?

CODE

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Private Sub Command1_Click()
    Dim done
    Dim myLink As String
    
    myLink = "https://docs.google.com/spreadsheets/d/1_XXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXX/pub?gid=0&single=true&output=csv"
    If Dir("C:\Test\Test.csv") <> vbNullString Then Kill "C:\Test\Test.csv"
    
    done = URLDownloadToFile(0, myLink, "C:\Test\Test.csv", 0, 0)

    If done = 0 Then
        MsgBox "File has been downloaded!"
    Else
        MsgBox "File not found!"
    End If
End Sub 

Swi

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close