Spotycus
New Member
- Joined
- Dec 8, 2015
- Messages
- 25
Hello,
I am still very new to VBA and will appreciate any assistance or suggestions. I am trying to automate a workflow process that would proceed like this:
The parts:
PRE VBA
Done.
Current code being used for the final steps:
Option Explicit
#If Win64 Then
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#Else
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#End If
Private Const SW_HIDE As Long = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWMINIMIZED As Long = 2
Sub Start_CSV2QBO()
'
' Start_CSV2QBO Macro
' Startup CSV2QBO
'
' Keyboard Shortcut: Ctrl+o
Application.Goto Reference:="worksheetaccount"
Selection.Copy
Application.Goto Reference:="worksheetcoa"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Paste from Ledger").Select
Range("A1").Select
Sheets("QBO Export").Select
Sheets("QBO Export").Copy
ActiveWorkbook.SaveAs Filename:= _
"E:\Downloads\Parkway\Checks.csv", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ShellExecute 0, "open", "E:\Program Files (x86)\CSV2QBO\csv2qbo.exe", vbNullString, "E:\", SW_SHOWNORMAL
End Sub
Thank you again in advance!
I am still very new to VBA and will appreciate any assistance or suggestions. I am trying to automate a workflow process that would proceed like this:
The parts:
transactions.xlsx - web generated download that contains my raw data (E:\\downloads\Parkway\transactions.xlsx)
datatemplate.xlsm - macro enabled excel sheet that already handles all my clean up and saves a new file checks.csv in the format needed
Checks.csv - file that needs to be selected by software program after it is opened using VBA.
Checks.csv - E:\\downloads\Parkway\checks.csv
CSV2QBO.exe - command line for second software (E:\\Program Files (x86)\CSV2QBO.exe)
Checkimport.qbo - final product that will be produced after running through software
datatemplate.xlsm - macro enabled excel sheet that already handles all my clean up and saves a new file checks.csv in the format needed
Checks.csv - file that needs to be selected by software program after it is opened using VBA.
Checks.csv - E:\\downloads\Parkway\checks.csv
CSV2QBO.exe - command line for second software (E:\\Program Files (x86)\CSV2QBO.exe)
Checkimport.qbo - final product that will be produced after running through software
PRE VBA
- GO to website and manually complete data entry to be able to export an excel file always named transactions.xlsx
- Open transactions.xlsx and click custom button (already on my custom ribbon) to start VBA process
- Open second workbook datatemplate.xlsm
- Import cells from transactions.xlsx into datatemplate.xlsm on sheet "rawdata"
- Data is Manually Verified and Next Macro is started
- New file checks.csv is created and saved, AND CSV2QBO software is opened.
- CSV2QBO window opens to choose the file to import
- NOTE: This is where I need help: I want to automate this part
- I want the program to auto select Checks.csv and start the process.
- The software will ask you to save and name the file Checkimport.qbo
- Open Google Chrome to a web address such as https://xyzsite.com
Done.
Current code being used for the final steps:
Option Explicit
#If Win64 Then
Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#Else
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
#End If
Private Const SW_HIDE As Long = 0
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWMINIMIZED As Long = 2
Sub Start_CSV2QBO()
'
' Start_CSV2QBO Macro
' Startup CSV2QBO
'
' Keyboard Shortcut: Ctrl+o
Application.Goto Reference:="worksheetaccount"
Selection.Copy
Application.Goto Reference:="worksheetcoa"
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Paste from Ledger").Select
Range("A1").Select
Sheets("QBO Export").Select
Sheets("QBO Export").Copy
ActiveWorkbook.SaveAs Filename:= _
"E:\Downloads\Parkway\Checks.csv", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ShellExecute 0, "open", "E:\Program Files (x86)\CSV2QBO\csv2qbo.exe", vbNullString, "E:\", SW_SHOWNORMAL
End Sub
Thank you again in advance!