

- #Application ontime excel vba android
- #Application ontime excel vba code
- #Application ontime excel vba Pc
It is set to synchronize automatically, so any changes made on my laptop are reflected (nearly) instantly on my phone, and vice versa. This is where the newly created Google Drive folder is located on my computer. So FullPath returns: C:\Users\Jon Peltier\Google Drive\_ Remote\ On my computer, Environ("UserProfile") returns the directory of my Windows account: C:\Users\Jon Peltier
#Application ontime excel vba code
I put this folder name into a VBA constant at the top of my code module: Const REMOTE_DIRECTORY As String = "\Google Drive\_ Remote"Īnd I referenced this constant in the FullPath function: Public Function FullPath() As StringįullPath = Environ("UserProfile") & REMOTE_DIRECTORY & Application.PathSeparatorĮnviron is a handy function that returns useful information about the user’s environment. To operate in Google Drive, I first created a top-level folder in my Drive account named _ Remote. I designed the first version of this remote VBA trigger mechanism to run using Google Drive, and then modified it to run in DropBox. I use the Debug.Print to tell me if a chart was exported. Set ws = ThisWorkbook.Worksheets("Sheet1")įileName = FullPath & "Chart_" & Format(Now, "yyyy-mm-dd_hhmmss") & ".png"įullPath calls a function to return the target directory for the exported image of the chart.

Here is the simple VBA routine that updates the data and exports a time-stamped image of the chart: Sub RecalcAndExportChart() Why a pie chart? It’s simple enough for a demo pie charts aren’t quite as evil as we’ve asserted for all these years and they make easily-distinguishable file icons when viewing a Windows directory, as shown in a screenshot at the end of this article. “Activate Monitoring” button is used to start the monitoring process I’ll talk about it in a bit. The data in C3:C8 is dynamic, in this example because the cells contain the formula =RANDBETWEEN(1,5). There is some data and a chart that displays the data. The Untriggered ProjectĪn oversimplification of the client’s project is shown below. To run successfully, the remote computer must be running Excel, with the applicable workbook open Excel’s Application.OnTime function must have started the monitoring process and a reliable file-sharing service must be synchronizing the target folder automatically.
#Application ontime excel vba android
It’s easy enough to create a dummy file in one of these shared folders from an Android phone, and even easier if a dummy file exists and all you need to do is rename it. I decided to base my solution on a synchronized folder in Google Drive or Dropbox, where the presence of a particular file triggers execution of the VBA procedure. He’s not using Office 365 or OneDrive, so he needed a low-tech remote VBA solution.
#Application ontime excel vba Pc
The client asked if I had a way for him to trigger the VBA procedure (macro) on his PC from his Android phone. I’ve recently helped out a client with a project that updated some data and exported a related chart.
