Is there a way to VBA a file to Google Sites?

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
Right now I have a button that puts the file on another computer. Is there a way to have it put on my Google Site using VBA?

Example it is:
strPath = "\\SIDONNA\Clients\"
can I change it to
strPath = "\\sites.google.com\site\ourcompanyname\ourfolder\



Thank You,
Michael
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Michael

How exactly does the current code put the file on the other computer?

There are Google Data APIs available but you might also be able to use FTP from VBA - never tried it.

How do you currently upload files to the site?
 
Upvote 0
We just started using the Google Sites. So we are now just manually uploading them.

This is what we use to upload to the other computer in the office:
Code:
Dim wb As Workbook, myFileName As String, myVal As Long, myMax As Long
    Dim strPath As String, fname As String, i As Integer
        If MsgBox("Have you printed your worksheets yet?", vbYesNo) = vbNo Then Exit Sub
        Application.ScreenUpdating = False
        Sheets("ESTIMATING").Select
        ActiveWorkbook.Save
        strPath = "\\SIDONNA\Clients\"
        On Error GoTo Failure
        Calculate
        myFileName = Range("A10").Value & ".xls"
'        ThisWorkbook.Worksheets("Estimating").Range("A10") = myFileName
            On Error GoTo Failure
                If Dir(strPath, vbDirectory) <> "" Then
            On Error GoTo 0
                ThisWorkbook.SaveCopyAs strPath & myFileName
            Else
                MsgBox "The directory to save the file cannot be found. " & vbCrLf & "So your data will not be sent." & vbCrLf & "Go get Michael!"
                Exit Sub
            End If
Failure:
        If Err = 52 Then
            MsgBox "You don't have a Network Connection. Or a computer is not turned on?"
        End If
        Application.ScreenUpdating = True

But I really would like it to go straight to our google Site if possible!

Thank you for any insite,
Michael
 
Upvote 0
Oh and what is a Google API?
Sorry if that is very ignorant! It is all new to me

Michael
 
Upvote 0
Michael

As far as I can see that code is just saving the file to another location, which happens to be a computer on your network.

I've not familiar with Google Sites, and Google APIs might be irrelevant when I think about it.

APIs are interfaces that can be used in code to work between different applications etc.

For example there's the Windows API which you can use to control, to some extent, well Windows, from code.

I looked into Google Sites (almost started creating my own :)) and there seems to be information about uploading when you search Help.

Not found anything on how to do it with VBA though.

Have you already uploaded files succesfully?
 
Upvote 0
only by hand.

I would love to do this programatically, it is so much easier!

Thank You for your insight though. Do you think I should post a similar post on VBA Express to see if someone on that sight may have some insight? Or would this be unnecessary cross posting?

Michael
 
Upvote 0
Michael

As long as you add a link back to this post most forums don't mind a bit of cross-posting.

It's when people cross post without regard that it becomes a problem.

Have you also checked the Google forums?

You might not find anything that's Excel specific but you might be find something for general file uploading.
 
Upvote 0

Forum statistics

Threads
1,215,351
Messages
6,124,445
Members
449,160
Latest member
nikijon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top