Create Access.Application after setting reference with Excel VBA,
I'm writing the process of executing DoCmd.TransferSpreadsheet and importing xlsx into accdb.
At this time, it basically operated normally,
I tested the table with duplicate primary key data and it passed without any error.
If i do the same process on Access VBA, a dialog saying "Could not add all data" is displayed,
Is there any way to display the dialog in the same way or cause an error?
Answer # 1
Isn't the Application.DisplayAlerts property set to output a message?
If so, please check Set Warnings.
Answer # 2
When Access is executed from Excel, the warning message and information message are not displayed, which is by design.
Even if I intentionally made an error, it ended as if nothing happened.
In VBA, when I use the on error statement to avoid an error, the content of the error is stored in the McroError property, but it was not.
(In the case where a file name that does not exist is specified, an error always occurs)
On the Access side, count the number of cases and check the number of registered cases and the number of original data, or once import into a table that stores anything, then register and detect inconsistency. I have no choice but to do it.
Somehow, it seems good to check the data on the Access side and display a message box or create a log file.
(The message box could be displayed.)
Answer # 3
The reason why it is unknown but it is probably a specification
- excel vba that does not overwrite and save only when an error occurs
- [vba] an error occurs when trying to save a recordset to adodbstream
- python - error occurs only in debug mode in vba
- ruby - an error occurs in yamldump using rspec string io
- vba error handling index is not in the valid range
- vba error handling "" range "method failed:" _global "object"
- java - kod-i want to know what to do when an error occurs in a method that should not have been written
- python - list index out of range error occurs for index 0
- python - time-out error occurs during communication
- about excel vba out of memory error
- small error occurs in calculation using% of python
- an error occurs when installing the postgresql12 develop file on aws (ec2)
- php - i want to solve the problem that an error occurs as soon as i put $result = $stmt-> fetch (pdo :: fetch_assoc) ;
- machine learning - unicodedecodeerror error occurs when creating original model of keras-yolo3
- unity - gui error: an error occurs when creating a folder or script
- a 400 error occurs when sending post from php to gas (google spread sheet) with curl
- vba - win32 api run-time error setthreaddesktop
- i get an error when getting a url using ie with vba
- access&excelvba how to handle blank data
- i want to use the export function (docmdtransferspreadsheet) of access from excel vba
- vba - please teach me how to centrally manage customer lists
- vba - how to launch an access file with a password from task scheduler
- vba - how to search in an access form like an excel autofilter
- vba - [database design] about table design when referencing/updating the access database using excel as an input screen
- excel vba end property cannot be used
- vba - i want to import the xlsx file in which the positional relationship between the item name and the contents of the data she
- i want to access access files on sharepoint from excel vba on my local pc (directly without using onedrive)