All Questions
24 questions
0
votes
1
answer
134
views
Return a Variant from a c dll to Excel VBA on macos
In Paulo Bueno's project https://github.com/buenop/MinXL he returns a Variant from a C++ dll, e.g.
Declare PtrSafe Function IncrementArrayBy _
Lib "/Library/Application Support/Microsoft/...
2
votes
0
answers
400
views
Unable to run C coded DLL in Excel VBA
I have a Windows 10 64-bits, Office 2013 32-bits and using MinGW64.
I followed instructions from https://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/
I checked other answers ...
0
votes
1
answer
51
views
I would like to replicate this nested for loop I have in c in an excel vba
Note:I'm aware that this explanation is confusing but when you look at the code I posted it will make a lot more sense. Feel free to suggest any edits.
I'm trying to recreate a a nested for loop I ...
2
votes
0
answers
59
views
Prevent Excel file from remember old DLL data. DLL Hell?
I've made simlpe C DLL:
void msgbox(long n)
{
char tmp[255];
sprintf(tmp, "%ld", n);
MessageBoxA(0, tmp, "DLL Message", MB_OK | MB_ICONINFORMATION);
}
void DLL_EXPORT ...
1
vote
1
answer
131
views
Malloc error in excel called .exe library
I'm using office 365 in 64 bit, with Windows 10 OS.
I compile my .exe file with Visual Studio 2017 Community.
Each time I met malloc() function, it report a violation of memory access.
It is nearly ...
4
votes
2
answers
9k
views
Use DLL in excel-vba
i would love to know how to declare and use a dll in vba. I have a code written in C and i would like to use some data from an excel sheet to test my c-code. How is it possible?
Many thanks in advance
2
votes
1
answer
808
views
Error accessing 64bit DLL function
I have created a 64bit DLL file using Microsoft Visual Studio 2015.
Visual C --> Win32 Project.
The code for squareMain.c is as follows :
long _stdcall square(long a)
{
return a*a;
}
The code ...
2
votes
2
answers
954
views
How can I receive "char *d" from DLL in VBA(Excel Visual Basic)?
Now I'm trying to get a char string as the below c function.
This is a C function of DLL,
char _stdcall *fmt_hex(long long num, int nbits, char *d)
{
sprintf(d, "0x%0*llX", (nbits - 1) / ...
0
votes
0
answers
57
views
editing table using vba
I'm trying to edit the following table (the left one in the picture): I have columns of x, y, test name, pass/fail (0 if pass and 1 if fail), and "firstFAIL" column.
For each pair of x and y I have to ...
2
votes
1
answer
981
views
Send a BSTR string written in a C DLL to Excel
I am trying to send a BSTR string written in a C DLL to Excel.
Problem:
Excel VBA receives the BSTR from the C DLL. I can see the BSTR in the VBA Intermediate window and debug window.
If I try to ...
1
vote
0
answers
110
views
Unexpected Results When Returing BSTR from DLL to Microsoft Excel VBA Application
I am writing a VBA extension in C, from what I have read VBA uses BSTR, which is just a WCHAR* with a length prefix. I have a function:
__declspec(dllexport) VB_STRING _stdcall getStr()
{
return ...
2
votes
2
answers
973
views
Excel VBA script crashes when calling a DDL function written in C, which returns a string BSTR
I'm using Code::Blocks to write a DLL in C which I intend to use in a Winbatch script but for the moment I'm testing it using Excel VBA.
The moment the VBA script runs the DLL getVersion() function ...
1
vote
2
answers
241
views
Excel VBA not working well with C dll for decimals - works fine with integers
I have a problem that really stumps me. Ultimately, I think that the problem could very well be down to my lack of knowledge about C programming for Windows or how to properly work between C and VBA.
...
1
vote
2
answers
4k
views
C++ to VBA (Excel)
So, basically, in Excel, I have 4 columns of data (all with strings) that I want to process, and want to have the results in another column, like this (nevermind the square brackets, they just ...
2
votes
1
answer
871
views
copy multiple pdf files data to excel in different worksheets
I have created a vba script to copy all data from multiple pdf files and paste in a excel in different tabs with the same name of the pdf files.
Problem is its copying data from pdf files and pasting ...
1
vote
1
answer
115
views
How to print a C BSTR in Excel 16 for Mac with VBA?
I have a C function which returns a BSTR like "Hello world" and in Excel 11 I can call this function to print the string with the msgbox vba function.
With Excel 16, I only have an returned empty ...
2
votes
1
answer
1k
views
Implementing Rosseta Code FFT into VBA Excel
I attempted to implement the FFT Rosetta Code into VBA excel. I was unable to reconstruct the same output data exactly as written in the Rosetta Code. At first I thought it was type conversion ...
-6
votes
2
answers
330
views
Translate this simple C code to VBA
I am looking to print an output that constitutes a string and a float.
For example, I calculated the density of a box using D = Mass/Volume. I would now like to generate an output saying "The density ...
4
votes
1
answer
1k
views
DLL compiled from C source code. Not able to use in excel VBA. File not found error
I have written a function in C (for some bitwise operations on 64-bit) and I want to use that function in my excel vba macro.
I used steps described here to create a DLL file using cygwin (64-bit).
...
0
votes
1
answer
219
views
VBA and dlls in C: Strategy for more responsive and controllable Excel performance?
I have an Excel workbook that another (3rd party. Not under my control) application pushes data onto. I have written various VBA functions that are triggered via an Worksheet.Change event when certain ...
1
vote
1
answer
64
views
Problems comparing integers to hardcoded values in a dll called from VBA
I am about to transfer a project I have written in Applescript and Objective C to Excel/VBA/dll. I have started with the Objective C functions that I want to place in a dll and call via VBA.
First of ...
2
votes
1
answer
310
views
C function in Excel 64 bit does not work as a worksheet function but works well in VBA
I am writing a 64 bit Dll in C which is then used in Excel 64 bit, and I am following a sample project from https://sites.google.com/site/jrlhost/links/excelcdll.
The example is simple. We write a ...
1
vote
1
answer
215
views
Declare a variable Registry in VBA?
New to VBA here. We can decare a variable as "Register" in C/C++ for very-very frequently accessed variable, ex- Loop iterator variables.
Does similar system exist in Visual Basic for Application. I ...
1
vote
1
answer
578
views
Call an executable of OCaml or C from VBA code
Under Ubuntu I have coded a very simple ml.ml in OCaml:
let () = print_string "hello world, in OCaml\n"
And a simple c.cin C:
#include <stdio.h>
main() {
printf("hello world, in C\n");
...