References" But now the problem...">

Using system.drawing in vba

I want to use system.drawing.dll in a VBA macro. I added it as a reference "Tools-> References" But now the problem starts, I cannot figure out how to use and call methods in the system.drawing.dll file. I access System_Drawing but it ends there. I can declare in VBA

         Dim image1 as Bitmap
         Dim ImageFunc as System_drawing.Image

      

But then I cannot download (or install ...?) The image in image1.

I did the same thing in Visual Basic 2010 and it works great. See Strike for code

Imports System.Drawing
....
        Dim image1 As Bitmap = CType(Image.FromFile(Path, True), Bitmap)
        image1.MakeTransparent(Color.White)
        image1.Save(Path)
        image1.Dispose()

      

How do I apply the same code but in VBA? I've tried different functions Declare, Set, etc., but nothing works. It gives me pleasure to skip the basics, even though I've googled and read about how to use C dlls in VBA.

+3
vba system.drawing


source to share


No one has answered this question yet

Check out similar questions:

502
How to avoid using Select in Excel VBA
4
A practical guide. Running existing Word VBA macros from C # Ribbon Addin
2
How to clone a range object in VBA
1
Providing VSTO VBA code: Missing link
1
Missing OTA library in Excel 2016 VBA
0
Attaching files to email with VBA
0
I have problems running VBA macro on 64 bit MacOS
0
Reference (output) parameters in VBA when using C # COM DLL
0
Do 32 bit VBA macros need to be updated to 64 bit if they reference 32 bit DLLs?
0
Call DLL function from vba excel 64 bit



All Articles
Loading...
X
Show
Funny
Dev
Pics